Send a email when a email from a particular template is sent - email

I want to sent a email every time a email from a particular template is send in Dynamics CRM 2011. I tried to use a workflow :
When a mail is created, i tried to add a condition to check the template of the mail which has been sent, but I can't find the condition on the template in the differents conditions available
Any Suggestions to create such a workflow?

You can try base your filter on a keyword in the subject of the mail. Can you try this ?

Related

Can I stop a SendGrid mail if it received a certain parameter?

I'm using a certain SendGrid template for several different projects and am trying to find a way to stop emails from going out in some conditions, through SendGrid.
For example, lets say I'm passing SendGrid some parameters like:
{id, name, amount, date}
I want to stop that email from going out when i'm passing a certain id.
I know that I can change the email template i'm sending with conditionals using handlebars:
From here
But Can I actually stop the mail if some condition happens?
In my case, every time I send the id = 5
You can control the body of the email using Handlebar templating, but by that point, you have already told SendGrid to send email with the data you provided. You cannot stop the email from being sent from within Handlebars.
If you're using code to tell SendGrid to send these emails, you could check in your code if the id equals 5, and if so, do not send an email.
If you're using Single Sends to send an email to SendGrid Contacts, you could to store this id field as a custom field, and create a segment or update your existing segment to filter out the contact with that id.

Restrict email recipients based on email keyword in MS Outlook 2010

I work in a medical study where study coordinators at several off-site locations will be sending sensitive data via email attachments. These emails will be encrypted, but I cannot have the emails going to anyone but one or two specific recipients. I need a method to restrict who can receive email attachments based on a keyword in the email subject line. We are using MS Outlook 2010.
Ideally, it'd work this way: If the sender's email's subject line includes a keyword like 'RestrictedEmail' then only designated email recipients (for example, king#kong.com or robin#hood.com) can receive the email, else, the email will not send.
I didn't see this elsewhere in archives. Maybe I'm not using the right keywords...
Thanks in advance!
Trap the Application.ItemSend event, look at the message subject (Mail.Subject). If the match is found, loop through the MailItem.Recipients collection and check each Recipient.Address property to make sure only approved addresses are present.

Powershell - Exchange 2013 filing script

I have been looking through the http://gallery.technet.microsoft.com/exchange/ website to no avail and was wondering if someone could help me please.
I would like to create a script that runs for every single email that is sent through exchange 2013. This script looks for an id email attribute that the email is assigned by my other script and if it has an id attribute the email will be moved to a shared mailbox on the exchange and put into a folder with the same id or create a new one if one doesn't exist.
Any help would be much appreciated! Thanks in advance.
Dint understand the query fully.
Looks like u want to write some code that will be executed for all the emails flowing through exchange.
Then Transport Agents are the way to go.
Here's the link which gives the documentaion regarding tranpsort agents in Exchange 2013.
http://msdn.microsoft.com/en-us/library/exchange/bb204097(v=exchg.150).aspx
You want to look for an "attribute" in the email and redirect emails based on that.
May be u can look for a message header in an email via transport agent and based on that perform redirection in the agent(removing all the recipients and adding 'redirectmailbox' as the only recipient).
You can also add custom headers to an email via transport agents.
http://blogs.msdn.com/b/mstehle/archive/2009/01/13/howto-sample-transport-agent-add-headers-categories-mapi-props-even-uses-a-fork.aspx
Transport Agents act on all the emails flowing through the orgnanisation.
Use them with caution.

Dynamics CRM 2011 - attach file to email before send

I have a pretty standard workflow in my Dynamics CRM 2011, which sends email when new entity is created. Now, before email is sent, I'd like to attach some attachments by plugin.
Is it possible to capture some before-send event on email activity, so I could create plugin that before email is sent, do some check on created message, attach files and send it?
Edit:
Files fetched by web service from another system, they are not attachements of other entities in CRM.
CRM will create the email and then send it, as two separate actions. So you should be able to add code to a post-create plugin on the email entity which adds the attachment. Presumably your workflow will add some flag to the email so your plugin knows which attachment to add to which email.
There are two messages on Email entity: Send and SendFromTemplate. You should be able to create PreSend or PreSendFromTemplate plugins and attach files.

Is it possible to send multiple email attachments with zend_mail?

I found several examples of sending a single email attachment using zend_mail. But I cannot figure out how to send multiple attachments. Can someone share how to do this if it is possible. I have sendmail installed on the server.
Yes its possible to send more than one attachment in a Zend_Mail_Message.
Depending on what method you use for creating attachments, just call $mail->createAttachment() once per attachment, or create all of your attachments as Zend_Mime_Part objects and call $mail->addAttachment($part) once for each attachment.
See Zend Mail Attachments for examples. Just repeat the example once for each file you want to attach.