As we all know communications are the backbone of any industry in the world. We all send and receive emails on daily basis. The process of sending mails automated will definitely shade our daily workload. Though, this process cannot be automated as a whole, but surely for the processes that need mails to be sent on a particular event or trigger. For example, if the business process needs to send a mail as soon as a user is registered for some kind of service, the log in credentials is changed etc. The same functionality can be built in the Sage CRM.
One of our clients had a requirement, the CRM user should get an automated email in the below scenarios:
- User is enabled for the CRM self-service portal, to inform the user with the same.
- The login credentials are changed of the respective user, along with the changed credentials.
- The communication should get created in the CRM against the out bound email as it is sent.
We have implemented the same at our end. Please allow me to explain in more detail. You just need to send the parameters to the below function as mentioned and mail will be sent automatically. Here is the list of parameters.
- pm_EmailAddress = Email Address to which mail needs to be send.
- pm_FullName = Full Name of the Person.
- pm_MsgBody = Message content
- pm_Subject = Subject line that needs to be in the mail.
Of course you need to have email out functionality enable from within Sage CRM.
var myMailObject = eWare.GetBlock(“messageblock”);
myMailObject.DisplayForm = false;
myMailObject.mSubject = pm_Subject;
myMailObject.mBody = pm_MsgBody;
myMailObject.mAddressFrom = “email@example.com”;
myMailObject.mNameFrom = “Sage”;
myMailObject.Mode = 2; //Set Mode to send(2) message is sent immediately.
Regarding creation of communication, you can make use of below function. Here you need to follow the below parameters.
- pmPersonid = Person Id for whom communication needs to be created.
- pmCompanyid = Company Id for whom communication needs to be created.
- pm_Sumbject = Subject line that needs to be in the mail.
- pm_EmailAddress = Email Address to which mail needs to be sent.
var sCurrentdate=new Date()
sUserId = new String(eWare.GetContextInfo(“User”,”user_userid”));
if(sUserId==”” || sUserId==”undefined” || sUserId==”null”) sUserId=””;
//’if the mail is send create the communication
var sCommRec = eWare.CreateRecord(“communication”);
sCommRec.comm_subject = pm_Sumbject;
sCommRec.Comm_TO = pm_EmailAddress;
sCommRec.Comm_DateTime = sCurrentdate.getVarDate();
//’get the communication id from the above record created
sCommId = new String(sCommRec(“Comm_CommunicationId”));
if(sCommId==”” || sCommId==”NULL” ||sCommId==”undefined”)sCommId=”0″;
//’Also create the record in the communocation link
var sCommLinkRec = eWare.CreateRecord(“Comm_Link”);
sCommLinkRec.CmLi_Comm_CommunicationId = sCommId;
sCommLinkRec.CmLi_Comm_CompanyId = pmCompanyid;
sCommLinkRec.CmLi_Comm_PersonId = pmPersonid;
sCommLinkRec.CmLi_Comm_UserId = sUserId;
You can make use of the above functions in any ASP page or TLS to achieve the mentioned functionality. Hope this helps!