Once an e-mail campaign is complete, you may want to delete it from the database. You can delete mailings manually through the ATG Dynamo Server Admin (see Viewing, Canceling or Resuming a Mailing), but you can also use either of the mechanisms described in this section to delete completed mailings automatically.

The TemplateEmailPersisterImpl class has a deleteWhenComplete property. If the value of this property is true (the default), the TemplateEmailPersisterImpl service deletes the mailing immediately after it completes successfully. If the mailing does not complete successfully, or if the deleteWhenComplete property is set to false, the mailing is not deleted.

In addition, the Personalization module includes an atg.userprofiling.email.TemplateEmailDeleter class that can delete mailings at scheduled intervals. You can use the mailingsToDelete property of the TemplateEmailDeleter service to specify the type of mailings to delete: completed, canceled, or failed mailings, or any combination of these.

The TemplateEmailDeleter service actually invokes the TemplateEmailPersisterImpl service to delete mailings, but the two deletion mechanisms operate independently. You can use the TemplateEmailDeleter service to schedule e-mail deletions even if the deleteWhenComplete property of TemplateEmailPersisterImpl service is set to false. Or you can set deleteWhenComplete to true (so that completed mailings are deleted immediately), and set up TemplateEmailDeleter to periodically clean up after failed or canceled mailings.

Typically, you want to invoke TemplateEmailDeleter when the server starts up, so you should add this service to the initialServices property of an atg.nucleus.InitialService component, such as the /atg/dynamo/service/Initial component.

The following table summarizes the properties of TemplateEmailDeleter:




TemplateEmailPersisterImpl service that is invoked to delete the mailings.

Default: /atg/userprofiling/email/TemplateEmailPersister


List of status values for mailings eligible for deletion; can be any combination of completed, canceled, and failed.

Default: completed


Indicates whether to delete only the mailings that are run from the server that this TemplateEmailDeleter is running on.

Default: true


Scheduler service used to schedule deletion of mailings.

Default: /atg/dynamo/service/Scheduler


The interval at which mailings are deleted.

Default: every 60 minutes

If your site has multiple ATG servers connected to the same database, you must set the thisServerOnly property to the appropriate value. If you want to use TemplateEmailDeleter on a single server to delete mailings run from all of the servers connected to the database, set the thisServerOnly property to false. If you want to have one instance of TemplateEmailDeleter per server to delete only the mailings run from that server, set the thisServerOnly property to true.

loading table of contents...