Custom rake task for contact deletion on Faspex

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 deleting contacts saved on user accounts.

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

Contacts are email addresses saved to a user’s contact list when users send a package to them. The list of contacts for a user can be viewed and removed from the Account link on the top right, under the Edit Contacts tab. Note that the contacts feature is only available when admins allow packages to be sent to external email addresses (email addresses not associated to a Faspex account) or when the Faspex user directory has been made private.

You can delete all the contacts belonging to a user with a rake task. The syntax is the following:

asctl faspex:rake custom:delete_user_contact -- [options] 
short form long form description                                                                                      
-uusername --username=username report file (required)
-femail_filter --email_filter=email_filter number of days covered by report (default: 7)
-h --help print out help information for this rake task

You must specify the username of the account you’d like to clear the contacts for. By default the rake task deletes all the contacts belonging to the user, but you can use the email_filter option to define a string so that only emails that contain it will be deleted.

Examples

To delete the contacts matching the example.com domain for the user janedoe, you would use the following:

asctl faspex:rake custom:delete_user_contact -- --username=janedoe --email_filter=example.com

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

Removing contact  hgranger@example.com
Removing contact  lizbennett@example.com
Removing contact  fbaggins@example.com
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk