-
Notifications
You must be signed in to change notification settings - Fork 12
Parcel Type: Entry Email
The Entry Email parcel type can send emails when entries are created, updated, deleted, and more. You can also specify HTML and plain text templates, along with sending the email with any service. Entry Email parcels are very powerful and can be configured in a lot ways.
The following events are used in this parcel type:
- entries.onSaveEntry
- entries.onDeleteEntry
- entryRevisions.onSaveDraft
- entryRevisions.onPublishDraft
- entryRevisions.onDeleteDraft
To Name
The name of the recipient.
To Email
The email address of the recipient.
From Name
The name of the sender.
From Email
The email of the sender.
Reply To
The reply to email address. (Optional)
Cc
The Cc email address or addresses. (Optional)
Bcc
The Bcc email address or addresses. (Optional)
Subject
The email subject.
HTML Template
The HTML template path.
Plain Text Template
The plain text template path.
Extra Conditionals
What extra conditionals should be used to validate this parcel? Return false
is you want to prevent the email from sending.
All the fields in the parcel can be static or dynamic. Each field is parsed with Twig. The tags that are available is obviously determined by your EntryModel
and how you have your sections setup. Each ParcelType
setting is parsed with the entry
variable. Then once the ParcelType
settings are parsed, the Service
settings are parsed with entry
and settings
variables. The settings
variable is the ParcelType
settings that were just parsed. The Service
is whatever service you chose to send the parcel. So to be clear, all settings will be parsed and can contain dynamic fields.
If you have parsing errors, these will appear when your parcel first fires. Don't be alarmed, just fix the errors and the email should send.
Example for Parcel Settings
{{ entry.title }}
{{ entry.entryId }}
{{ entry.yourEntryField }}
{{ entry.author.email }}
{{ entry.author.firstName }}
{{ entry.author.lastName }}
Example for Service Settings
{{ entry.title }}
{{ entry.entryId }}
{{ entry.yourEntryField }}
{{ entry.author.email }}
{{ entry.author.firstName }}
{{ entry.author.lastName }}
{{ settings.toName }}
{{ settings.toEmail }}
{{ settings.fromName }}
{{ settings.fromEmail }}
{{ settings.replyTo }}
{{ settings.cc }}
{{ settings.bcc }}
{{ settings.subject }}
{{ settings.body }}
{{ settings.htmlBody }}
Note, these are just a sample of the variables that are available. In addition to variables, these fields are parsed just like regular templates. Any and all Twig logic may be used to parse your fields.