# Tag Event Script - Alarm Active Email

**URL:** <https://forum.inductiveautomation.com/t/tag-event-script-alarm-active-email/23514>\
**Category:** Ignition\
**Created:** [March 21, 2019, 5:05pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-alarm-active-email/23514 "2019-03-21T17:05:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [March 21, 2019, 5:05pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-alarm-active-email/23514/1 "2019-03-21T17:05:49Z")

</div>

Just wanted to share a script to send an email to multiple people for multiple alarms in a DataType.

```
#Declare Variables and Bind to Alarm UDT Configuration Tag
eventTime = system.date.format(system.date.now(), 'h:m:s a') 
displayPath = str(alarmEvent.displayPath)
emailBody = "<b>" + alarmName + "</b> on <b>" + displayPath + "</b> went into alarm at " + eventTime + "." 
recipient1 = system.tag.read("[default]Config_AlarmEmail/Recipients[0]")
recipient2 = system.tag.read("[default]Config_AlarmEmail/Recipients[1]")
recipient3 = system.tag.read("[default]Config_AlarmEmail/Recipients[2]")
recipient4 = system.tag.read("[default]Config_AlarmEmail/Recipients[3]")
recipient5 = system.tag.read("[default]Config_AlarmEmail/Recipients[4]")	
#recipients need to be in a list form [List,etc..]
recipients = [recipient1.value,recipient2.value,recipient3.value,recipient4.value,recipient5.value]
fromaddress = system.tag.read("[default]Config_AlarmEmail/From")
emailProfile = system.tag.read("[default]Config_AlarmEmail/IgnitionEmailProfile")

#Send Email	
system.net.sendEmail(smtpProfile=emailProfile.value, fromAddr=fromaddress.value, subject="Ignition Alarm Notification", 
body=emailBody, to=recipients, html=1)
```

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [March 21, 2019, 7:28pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-alarm-active-email/23514/2 "2019-03-21T19:28:15Z")

</div>

Why not use the alarm notification pipeline?

---

<div class="post-metadata">

**Author:** ![DSI600](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@DSI600](https://forum.inductiveautomation.com/u/DSI600)\
**Post date:** [March 21, 2019, 8:07pm UTC](https://forum.inductiveautomation.com/t/tag-event-script-alarm-active-email/23514/3 "2019-03-21T20:07:19Z")

</div>

That would be the first choice, but the customer did not want to add the alarm notification module.
