- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Let's talk about
- Three simple steps to resend emails
- If the email has attachments, how to pre-prepare them for re-sending
- How to set the email to be ready to be sent
- Why do we need to wait until it gets processed
Three simple steps to resend email
I'll try to cover some cases of re-sending emails from an instance.
Most cases, are straight forward. However, if the email has failed or it has attachments, you may want to consider additional steps.
There are three(3) simple steps to resend emails:
- If the email has attachments, pre-prepare them for re-sending.
- Set the email to be ready to be sent
- Wait until it gets processed
Step 1. If the email has attachments, pre-prepare them for re-sending.
If the email has attachments and it has failed (e.g. IO Message Error), please prepare them for re-sending.
If it does not have attachments, just go to the next step (2).
- Open each email with attachment:
- Save all the attachments from the email.
- Delete all the attachments from the email itself.
- Save the email record.
- Add all the attachments extracted previously (on step 2).
- Save the record.
NOTE: Exporting the XML record and re-importing back does not necessarily work.
Example to show how to pre-prepare email with attachments for re-sending
Open the email, and then go to "manage attachments".
Then save all the attachments:
Then remove all the attachments, and save the email.
Then re-attach all the emails saved previously.
Then save the email.
Step 2. Set the email to be ready to be sent
If the email has errors, fix them. Usual errors are wrong addresses, too many recipients, etc. Validate the error and correct them. Manual fixes sometimes are required.
Then set the email type to "send-ready" and save. Internally, a business rule will run.
Then re-open and set Mailbox = "Outbox" and State = "Ready". Then save.
Example of how to set the email to be ready to be sent
Set the email Type to "send-ready":
Then open each email and set Mailbox = "Outbox", and State = "Ready".
Example script to reprocess emails
An alternative example script to reprocess the emails with "send-failed", "send-ignored", and "send-ready" in all states is:
// Set queryString with the query to perform -- USE CAREFULLY
queryString = "typeINsend-failed,send-ignored,send-ready^sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)"
var gr = new GlideRecord('sys_email');
gr.addEncodedQuery(queryString);
gr.query();
while (gr.next()) {
gr.type = "send-ready"; // this is the first update
gr.update();
gr.mailbox = "outbox"; // note this happen as a second update
gr.state = "ready";
gr.update();
}
Additional note: Note there is a "Resend" button if the email Type = "sent".
This is only useful if the email was sent correctly on the first place.
Step 3. Wait until it gets processed
Then if you have enabled the outbound email services, they will be resend on the next cycle.
This is usually 30-sec to 1 minute.
Hopefully they will be sent without problems.
Conclusion
Re-sending emails require three steps. If the email has attachments, pre-prepare the attachments for re-sending, then set the email to be ready to be sent and finally wait until it gets processed
Review what have your learn
After reading this blog you will know:
- How to re-add attachement to emails
- How to set an email to be ready to deliver
- Where is the 'Resend' button on emails
More information can be found here:
Note: Tested in Fuji, with Chrome
- 13,387 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.