Skip to main content
 print this page

Send alert/email through ETL Jobs

User can send EMAILs at the time of job run. For previously created job, an edit of the job is required to utilize this feature.

Below is the sample python code that should be used to send an EMAIL

queue_name = boto3.client("ssm").get_parameter(Name="SYSTEM.NOTIFICATIONS.QUEUE")["Parameter"]["Value"]
sqs_resource = boto3.resource("sqs")
notification_queue = sqs_resource.get_queue_by_name(QueueName=queue_name)
email_subject = "Subject of the email"
message = """Successfully performed required operation.
Write the message that needs to be send
"""
body = {
"Gist": message,
"EmailType": "info",
"EmailFields": {},
"SetProjectInfo": True
}
response = notification_queue.send_message(
MessageBody=json.dumps({
"priority": "low",
"notifyTo": {
"email": {
"emailFrom": "oliver@cloudwick.com",
"emailSubject": email_subject,
"userGroup": "Users",
"notifyUsers": [
"apollo@cloudwick.com"
],
"messageBody": {
"messageType": "text",
"notificationMessage": body
}
}
}
}),
MessageGroupId="alertUser"
)

To utilize this functionality at the time of job creation or job update user needs to provide SYSTEM.NOTIFICATIONS.QUEUE in Parameter Access.

If Mail server used is default then email addresses used for from and to addresses should be subscribed the Amorphic application to leverage this feature.