Custom rake task for emailing Faspex users

Rake tasks are scripts that allow you to retrieve, delete or update information on your Faspex server using the command line. This article describes a custom rake task available for sending emails to Faspex users.

Please note that you must install this rake task as it is not yet included by default on Faspex. For more information on custom rake tasks and how to install them, see this article (Custom rake tasks on Faspex).

Usage

You can send an email message to Faspex users with a rake task. The message is made up of the contents of a file passed to the command, and is sent to all users in BCC. Emails can be sent to individual users, or to all Faspex users. The syntax for this rake task is as follows:

asctl faspex:rake custom:send_all_users -- [options]

 

short form long form description                                                                                      
-bfile --email_body=file file containing the email body (required)
-m --html email body to be processed as HTML
-ssubject --subject=subject print only Workgroup users, not Dropbox users
-uuser --user=user username of the account to send the email to
-fuser --from=user Faspex user the email shows as being from (required)
-a --all send to all users (Faspex/external/directory/self registered)
-d --directory send to any DS user (LDAP/AD/SAML) in addition to any Faspex user
-e --external send to any external user in addition to any Faspex user
-r --selfregistered send to any self registered user in addition to any Faspex user
-t --testmode performs a user lookup but does not send the email
-h --help print out help information for this rake task



By default the email message is sent as text to all Faspex users. The -t option does not cause an email to be sent but instead prints out the users specified in the command.

 

Examples

In order to send an email on behalf of the admin user aspera with the subject “Urgent” and the body with the contents in the file /tmp/email_msg.txt to all users, you would use the following:

asctl faspex:rake custom:send_all_users -- --subject=“Urgent” --from=aspera --email_body=/tmp/email_msg.txt


To send an email to the user janedoe from admin with the subject “Updates to your Faspex account”, and the HTML message from /tmp/jane.txt, you would use the following:

asctl faspex:rake custom:send_all_users -- --subject=“Updates to your Faspex account” --from=aspera 
--user=janedoe --email_body=/tmp/jane.txt --html

 

To list the external users that would be included in an email without actually sending an email, you would do the following:

asctl faspex:rake custom:send_all_users -- --email_body=/tmp/body.txt --subject="Faspex updates" 
--from=admin --testmode -e

 

Below is an example of what the output could look like:

Found user: admin[admin@example.com] as LocalUser, adding 
Found user: janedoe[janed@example.com] as LocalUser, adding 
Found user: rweasley[rweasley@example.com] as ExternalUser, adding
Sent email for the last  3 users
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk