If all you need is the ability to send e-mails from CRM, instead of implementing KnowledgeSync or TaskCentre this job will allow you to easily send emails from anywhere inside of CRM.
Using the Mail Queue Job
To use this job, simply perform the following steps:
- Install the provided bundle Customer FX Mail Queue Job
- Once installed, open the Job Service portal in Application Architect.
- Right click the FX.MailQueue.Job under the Jobs tab and select “Add Schedule”.
- Set the schedule to execute “every 1 minute“.
- Under the SupportFiles tab of the Job Service portal, locate the file “FXMailQueue.config” and double-click it to edit.
- Edit the file to add your SMTP settings, then save it.
- Deploy the Job Service Portal.
- Restart the windows service “Saleslogix Job Service”
To use, simply add a record to the MailQueue table. This can be done directly in SQL, SData, or using the entity model. For example:
var mail = Sage.Platform.EntityModel.Create<Sage.Entity.Interfaces.IMailQueue>(); mail.ToAddress = "email@example.com"; // can be mulitple recipients, comma-delimited mail.FromAddress = "firstname.lastname@example.org"; mail.Subject = "Test Email"; mail.Body = "This is a test e-mail"; // optional, record as a note on a contact mail.RecordForContactId = "CXXXX0000001"; // optional, attach a file mail.AttachmentPath = @"C:\SomeFolder\SomeFile.pdf"; // optional, delay sending until a specific date/time mail.DelayUntil = DateTime.Now.AddMinutes(30); mail.Save(); // now the mail will be sent
There is also an entity business rule on the MailQueue entity called MailQueueProcessed. This business rule will be executed for each e-mail processed, allowing you to add custom logic to the processing of each e-mail.
Note: If an error occurs when sending the e-mail, the MailQueue record will be updated with the error details and the job will attempt to send it again on it’s next execution. If the email is sent successfully, the MailQueue record will be deleted.
Download the Customer FX Mail Queue Job
Note: Source is also available on Github, visit the repository here.
The following articles will assist you in getting started
The Customer FX Mail Queue Job is licensed under the GNU v3.0 License. View the license details.