 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demo how you can send email alerts using workflow rules. If you want to watch more Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can follow my YouTube channel. So if you want to create any workflow rule, then quick find you need to search for workflow rules. So this option will be available. You can select this option. Then it will show an introduction page showing what we can do with workflow rules along with examples. So if you click on continue, you will see this screen. So it is showing all existing workflow rules. So if you want to create new one, click on new rule, select object and selecting contact object. Clicking on next. So now here we need to mention three things, a rule name, evaluation criteria and rule criteria. So send email alerts. So it is name of rule. So this is demo workflow rule for email alerts and description you can fill as per the requirement. Then for evaluation criteria and choosing created and every time it's edited as of now. So this workflow rule will work while creating a record or editing any record. Right. And here we can put criteria. So I'm putting the criteria that email should not be blank. So I'm searching for the email field. Yeah, here it is operator and it is I'm leaving it as blank. So email not equal to blank. So if email is not blank, then this will be fired. If you want to add more rule criteria so you can choose any other field and then you can set operator and values accordingly. You can also mention filter logic that will be for and or or. So here is the example you can choose accordingly. So right now we have only one field so and then or are not required here. Now I'm clicking on saving next. So I mentioned evaluation criteria as well as rule criteria. So email should not be equal to null. Then it will be fired. So here I need to choose new email right so I'm clicking on it. So whenever you want to send any email alert so you need to choose this option. So here you need to put description unique name object is by default selected then email template. So first you need to create emails template also if you want to choose email alert option right. So now I'm opening one more tab. So I'm going I'm going to create email template and then I will link that email template. With that email alert right so I'm selecting text. So this is a demo email template. So in my another videos those are related to Salesforce admin lightning experience. You can see how we can create email templates. So here we need to choose a folder. So I'm choosing test email templates available for use. Then for contact alerts it is the name then subject congratulations registered. So this way this is the demo subject then email body high congratulations. Thanks. So this is demo email body. Now I just want to add name of the contact also so here you can see much fields are available. So contact is by default selected then I'm selecting name field. So this is the merge feeling value that I can copy and I can paste it here. So this merge field will be replaced as per the record that you will be creating or updating and attaching this email template with email alert so it will automatically be updated. Right. So this way we created this email template that is for contact email. So now I'm moving to email alert. Right. So if I click on this look up. So let me first refresh it so that that will be available. So I'm refreshing this window so that that email template will be available in this email alert. So now if I click on this look up in words for contact email alerts I'm typing that clicking on go. Yes. I selected wrong folder. So now you can see it is available here and selecting it. So this way I selected email template now send emails to contact. And here you need to choose the recipient type. So you can choose any of this option that is suitable. So on contact we have email so I want to send email to that email ID that is available on contact email field. If you want to send emails to additional emails like in CC so you can choose five email address and you can type them here. And from email address so that will be current users email address so that will be my email address. So I'm clicking on save. So this way you can see I created email alert. And now I'm clicking on done. So what the rule is created. Now I'm activating it so that it will be fired whenever I will be creating any contact or editing or updating any content. So now I'm going to open this my university app. And this is my mailbox. So right now it is not having any early emails. So now I'm going to create one contact record. So this time. Put in last name. First name is my so full name will be my test email. So you will see my test email name in the email that will be sent out because we choose merge field. Then email should not be blank. So I'm putting such a dot school. And I'm clicking on save. So record is created. These are the details. Right. And let's check the mailbox where the email is available or not. So it is refreshing. Yeah, here you can see this is a congratulation email. And these are old emails. Yeah, this is a congratulation email. So I'm opening this. So because my email ID for both contact and user is same. So that's why it's sent to me. And here you can see name is my test email and that message that we typed in email template. So this way it is working fine on creation of the contact. Right. Let's create one more. So my test. And this time I'm leaving this email as blank and clicking on save. So let's see what happens whether it triggers email or not. So I'm doing a refresh. So you can see it is not triggering any email because email field is blank. And our workflow will fire when it is having some value. So now I'm going to modify this record so that I can provide an email. Again, I'm putting my email address and clicking on save. So now you will see while editing and if we provide email that is not blank. So it will trigger email automatically. So you can see it is triggering a email. So now I test email to this is the name and rest of the message is same because that is a static or plain text must fields are replaced automatically. So this way you saw on creation and on updation on both scenarios. This workflow is working and finding a email alert. So I hope you understood how we can send email alerts by record creation and updation using buffer rules. I hope you understood whatever I demonstrated in this video. If you want to watch more Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can follow my YouTube channel. Thank you for watching this video.