Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


The data that will be used to create the email body and indicate the list of recipients needs to be added to the intermediate object of a pipeline.

Properties

PropertyDescriptionDefaultTypeRequired
typeStage class name-stringYes
enableEnable stage for executiontruebooleanNo
nameName for this specific stagestringNo
save_to_intermediateIf true, the result of the stage will be stored in the intermediate instead of the final sectionfalsebooleanNo
data_preparation_stage_nameIndicates the name of the stage that contains and prepares the data to be sent via email.-string
No
Yes

Example Configuration

Code Block
languagepy
themeDJango
_send_mail = SendEmailStage(
    data_preparation_stage_name="prep_stage",
    enable=True,
    name='send_mail_stage',
)

...

The data that will be used to send an email needs to be on the intermediate object and must have these properties:


PropertyDescriptionDefaultTypeRequired
from_emailEmail that will be used as a source of all the emails sent.-stringYes
to_emailList of all the email addresses that will be recipients of the emails sent.-listYes
subjectSubject of the email sent.stringString
data_url(Optional) Comes from the default template. A value that will be replaced on the template.-stringNo
username(Optional) Comes from the default template. A value that will be replaced on the template.-stringNo



Example of Data needed to send emails (Intermediate object)

Code Block
languagepy
themeDJango
data={
  "from_email": "[email protected]",
  "to_email": ["[email protected]", "[email protected]"],
  "subject": "This is a test",
  "data_url": "http://example.com/",
  "username": "This is an example"
}
Note

IMPORTANT!

If you plan to use gmail as the email sender you need to follow these steps first!