emms -- email mass sendmass send module for labware mass send li… · emms -- email mass sendmass...
TRANSCRIPT
EMMS EMail Mass SendEMMS -- EMail Mass Send module for Labware
By Jim Meichsner & Paul Osterholt, National Centers for Animal Health,
U.S. Department of Agriculture, Ames IA
Background
What it is:• A module for LabWare to send large numbers of customized g
email messages
Reason for making it:• October 2013 government shutdown• USDA-Ames sent an email to current customers (over 2000
database records)database records)• Going forward we can use this module to notify current
clients or subsets of clients.
© LabWare 2014 Results Count www.labware.com EMMS slide 3
What EMMS does:
From Labware, it creates, tracks, allows editing and transmits mass emailsediting, and transmits mass emails.
It can transmit test versions of the emails. It accesses the Labware database for email
addresses and other relevant information. Developers can customize code for
processing and formatting these emails.
© LabWare 2014 Results Count www.labware.com EMMS slide 4
Example -- Diagnostic Replenishment Kits
USDA-Ames needs to send diagnostic kits to some customersto some customers.• Identified in our PERSON table by an added column
Before sending the kits we want to confirm Before sending the kits we want to confirm the shipping address by email.One of the goals of EMMS was to facilitate One of the goals of EMMS was to facilitate these address-confirmation emails.
© LabWare 2014 Results Count www.labware.com EMMS slide 5
EMMS Replenishment Kit Example
(1) Run through menu (2) Create new entry
© LabWare 2014 Results Count www.labware.com EMMS slide 6
EMMS Replenishment Kit Example
(3) Add title (4) Add recipient type
© LabWare 2014 Results Count www.labware.com EMMS slide 7
EMMS Replenishment Kit Example
(5) Add recipient details (6) Add subject of email
© LabWare 2014 Results Count www.labware.com EMMS slide 8
EMMS Replenishment Kit Example
(7) Add who is “officially” sending the email
© LabWare 2014 Results Count www.labware.com EMMS slide 9
EMMS Replenishment Kit Example
(8) Add email body (This can be formatted in the HTML-Note-Box.)
© LabWare 2014 Results Count www.labware.com EMMS slide 10
EMMS Replenishment Kit Example
(9) Add “test recipients” for test email messages
© LabWare 2014 Results Count www.labware.com EMMS slide 11
EMMS Replenishment Kit Example
(10) Add attachment (optional)
© LabWare 2014 Results Count www.labware.com EMMS slide 12
EMMS Replenishment Kit Example
(11) Get acknowledge message (12) Back to main menu
© LabWare 2014 Results Count www.labware.com EMMS slide 13
EMMS Replenishment Kit Example
(13) If you choose the editing option, you can change any item
© LabWare 2014 Results Count www.labware.com EMMS slide 14
EMMS Replenishment Kit Example
(14) Choose “Display” option to see details of the current entry …
(15) … and see a summary.
© LabWare 2014 Results Count www.labware.com EMMS slide 15
EMMS Replenishment Kit Example
(16) To check the output of your email, choose “Test”
(17) System will send emails then give conclusion message
© LabWare 2014 Results Count www.labware.com EMMS slide 16
EMMS Replenishment Kit Example
(18) Show 1st of 3 test emails: (19) Show 2nd of 3 test emails:
© LabWare 2014 Results Count www.labware.com EMMS slide 17
EMMS Replenishment Kit Example
(20) Show 3rd of 3 test emails
© LabWare 2014 Results Count www.labware.com EMMS slide 18
EMMS Replenishment Kit Example
(21) Choose “Send” (22) Receive confirmation email
© LabWare 2014 Results Count www.labware.com EMMS slide 19
EMMS Features
May save a current entry & continue later Able to copy an existing EMMS entry Able to copy an existing EMMS entry Anyone can create an EMMS entry Only authorized users can send the mass
emails (based on a functional privilege) Testing functionality sends up to 3 emails
to the “test recipients” • Anyone can send a test email to themselves
© LabWare 2014 Results Count www.labware.com EMMS slide 20
More EMMS Features
Builds on email features developed previously:• Each email is stored in an email audit table• Each email is stored in an email audit table
(X_EMAIL_SEND_AUDIT) Can transmit emails from a background processorg p
• 2013 email list included over 2000 addresses• This allows a user to continue to use their LabwareThis allows a user to continue to use their Labware
session while the emails are transmitted Sends a confirmation email when done
© LabWare 2014 Results Count www.labware.com EMMS slide 21
When Sending a Mass Email:
The module calls code to loop through the email addresses (or entries)email addresses (or entries)
The module uses a pair of customized subroutinessubroutines• One subroutine is called BEFORE the loop
Oth b ti i ll d INSIDE th l• Other subroutine is called INSIDE the loop and run once for each address
© LabWare 2014 Results Count www.labware.com EMMS slide 22
Specialize with Pairs of Subroutines
Therefore, to add a new or personalized way to send a mass email:way to send a mass email:• Using existing subroutines as templates, create a
new pair of subroutinesnew pair of subroutines• Add the name of the first subroutine to a list
• The second subroutine matches the name of the first subroutine with a suffix of “_IN_LOOP”
• Users can then choose that new subroutine when creating a new EMMS entrycreating a new EMMS entry
© LabWare 2014 Results Count www.labware.com EMMS slide 23
Hypothetical Customization Example
Hypothetically, say we wanted to send each 2013 customer a list of their projectscustomer a list of their projects
We might create a new pair of subroutines• First sub: put the unique customers into an arrayp q y• Second sub: For each customer in that array:
• Look up that customer’s address dataL k th t t ’ j t• Look up that customer’s projects
• Customize each email body with that info and transmit
© LabWare 2014 Results Count www.labware.com EMMS slide 24
Conclusion / What we expect …
Allows us to audit all mass emailsC t t il i d t d Can repeat past emails using updated information
Will enhance our labs’ communication and notifications with their users and customerscustomers
© LabWare 2014 Results Count www.labware.com EMMS slide 25
Appendix A – View of subroutines
A group of new subroutines • PAGE ONE• EMAIL_MASS_SEND_MENU_CONTROL
• EMAIL_MASS_SEND_CREATE_ROW• EMAIL_MASS_SEND_PICK_RECPNT_OPTION• EMAIL_MASS_SEND_PICK_RECPNT_VALUE
• EMAIL_MASS_SEND_PICK_FADDEMAIL MASS SEND PICK SUBROUTINE• EMAIL_MASS_SEND_PICK_SUBROUTINE
• EMAIL_MASS_SEND_PICK_ADDRESS_FILE• EMAIL_MASS_SEND_DB_INSERT_ROW
• EMAIL MASS SEND POPULATE ENTRY VALUESEMAIL_MASS_SEND_POPULATE_ENTRY_VALUES• EMAIL_MASS_SEND_ADD_ATTACHMENT
© LabWare 2014 Results Count www.labware.com EMMS slide 26
Appendix A – View of subroutines cont.
Each sub is modular and changeableTh f h b dj t d b it lf Therefore each can be adjusted by itself
• Page Two• EMAIL_MASS_SEND_COPY_ROW• EMAIL_MASS_SEND_SELECT_ROW
• EMAIL_MASS_SEND_DB_INSERT_ROWEMAIL MASS SEND POPULATE ENTRY VALUES• EMAIL_MASS_SEND_POPULATE_ENTRY_VALUES
• EMAIL_MASS_SEND_DISPLAY_ROW
© LabWare 2014 Results Count www.labware.com EMMS slide 27
Appendix A – View of subroutines cont. Page Three
• EMAIL_MASS_SEND_EDIT_ROW• EMAIL_MASS_SEND_EDIT_TEXT_FIELD
• EMAIL_MASS_SEND_UPDATE_TEXT_FIELD• EMAIL_MASS_SEND_PICK_RECPNT_OPTION• EMAIL_MASS_SEND_PICK_RECPNT_VALUE
• EMAIL MASS SEND PICK FADD• EMAIL_MASS_SEND_PICK_FADD• EMAIL_MASS_SEND_PICK_SUBROUTINE• EMAIL_MASS_SEND_PICK_ADDRESS_FILE
• EMAIL_MASS_SEND_SAVE_RECPNT_DATA_ _ _ _ _• EMAIL_MASS_SEND_UPDATE_TEXT_FIELD
• EMAIL_MASS_SEND_EDIT_HTML_NOTE• EMAIL_MASS_SEND_UPDATE_NUMERIC_FIELD
• EMAIL_MASS_SEND_ADD_ATTACHMENT
© LabWare 2014 Results Count www.labware.com EMMS slide 28
Appendix A – View of subroutines cont. Page Four
• EMAIL_MASS_SEND_CHECK_AUTHORIZATION• EMAIL_MASS_SEND_TEST_EMAIL <<may be sent to background>>
• <<set testing flag to true>>• EMAIL_MASS_SEND_GET_ADDR_FROM_HTML_NOTE• EMAIL_MASS_SEND_PREPARE_CONTENTS• EMAIL MASS SEND ADJUST ADDDRESS• EMAIL_MASS_SEND_ADJUST_ADDDRESS• EMAIL_MASS_SEND_LOOP_FOR_EMAILING
• <<customized subroutine #1 BEFORE loop>>• <<inside loop>> <<customized subroutine #2>>p• <<inside loop>> EMAIL_MASS_SEND_ADJUST_ADDDRESS • <<inside loop>> SYS_SEND_EMAIL_WITH_AUDIT
• Code: send_status = SendSMTPMailMessage(subject, … )• << adds entry to X_EMAIL_SEND_AUDIT table>>
• EMAIL_MASS_SEND_APPEND_TO_HTML_NOTE
© LabWare 2014 Results Count www.labware.com EMMS slide 29
Appendix A – View of subroutines cont. Page Five
• EMAIL_MASS_SEND_CHECK_AUTHORIZATION• EMAIL_MASS_SEND_EXECUTE_SEND_OFF <<may be sent to background>>
• EMAIL_MASS_SEND_PREPARE_ADDRESSES• EMAIL_MASS_SEND_APPEND_TO_HTML_NOTE
• EMAIL_MASS_SEND_LOOP_FOR_EMAILING• EMAIL MASS SEND PREPARE CONTENTS• EMAIL_MASS_SEND_PREPARE_CONTENTS• <<customized subroutine #1 BEFORE loop>>• <<inside loop>> <<customized subroutine #2>>• <<inside loop>> EMAIL_MASS_SEND_ADJUST_ADDDRESS p _ _ _ _• <<inside loop>> SYS_SEND_EMAIL_WITH_AUDIT
• Code: send_status = SendSMTPMailMessage(subject, … )• << adds entry to X_EMAIL_SEND_AUDIT table>>
• EMAIL_MASS_SEND_APPEND_TO_HTML_NOTE• EMAIL_MASS_SEND_CONFIRMATION
© LabWare 2014 Results Count www.labware.com EMMS slide 30
Appendix B – X_EMAIL_MASS_SEND
New Table with → KEY_NUMBER → ENTRY_TITLE→ RECIPIENT_TYPE → RECPNT_LITERAL→ RECPNT_SUBROUTINE → RECPNT_FILE→ RECPNT_FADD → RECPNT_CRITERIA→ EMAIL SUBJECT → EMAIL FROM→ EMAIL_SUBJECT → EMAIL_FROM→ EMAIL_BODY → TEST_RECPNT→ DELIVERY_NOTIFY_EMAIL → BKGRD_MESSAGE→ BKGRD_DATE → CREATED_BY→ CREATED_DATE → MODIFIED_BY→ MODIFIED_DATE → SENT_BY→ SENT_DATE → STATUS
REMOVED ATTACH FILE NAME→ REMOVED → ATTACH_FILE_NAME
© LabWare 2014 Results Count www.labware.com EMMS slide 31
Appendix C – X_EMAIL_SEND_AUDIT
Table with → KEY_NUMBER → SUBJECT→ NOTE → REMOVED→ CHANGED_ON → CHANGED_BY→ DBFILENAME → SEND_TIME
OUTPUT TYPE ERROR MESSAGE→ OUTPUT_TYPE → ERROR_MESSAGE→ CCLIST → EMAIL_ADDR→ EMAIL_SEND_KEY → EMAILSERVERNAME→ FILELIST → SEND STATUS→ FILELIST → SEND_STATUS→ THE_USER
© LabWare 2014 Results Count www.labware.com EMMS slide 32
Any questions??
© LabWare 2014 Results Count www.labware.com EMMS slide 33