Hello,

 

I've created a set of new email templates that include both standard and custom macros sourced from macros in related objects. To share these templates with my colleagues, I’ve attached the email templates to my current package using an EmailTemplate data file. However, the custom macros within these templates aren't being included; my colleagues are seeing only the email template itself without the custom macros in their message templates.

 

When I attempt to bind the macros using an "EmailTemplateMacros" data file, I’m only given the option to include basic macros—none of the custom macros from pre-defined objects appear. Does anyone know how to properly bind these custom macros to the email templates so they appear for others?

 

Thank you!

n.b. some of the basic macros that I am able to join seem to be generic fields, not the fields I want to bind - see below...

 

Like 3

Like

2 comments

Greetings!
 


The data is stored in the object—EmailTemplate.


Please check, on the dev site where the template was originally created and the data was bound, that you have bound the TemplateConfig and ConfigType columns to this data, and if you have checked the “Forced Update” checkbox for these columns

Regards,
Orkhan

Orkhan,

Thank you!

Show all comments

Hi Community, 

 

We are looking to insert non-contact macros in email template. We have an object with two fields - rate and duration. These fields are not connected to any object and have only one record. We want to insert these two values in an email template. How can we go about it?

 

Thanks

Like 0

Like

1 comments

Hello!

 

In the current version of the system, macros cannot be added from objects that are not linked to a contact or to bulk emails in the template. The object must be connected to a contact for the macros to be available. 

 

We created a request to our development department for further implementation in the next versions of the system. 

Show all comments

Hi Community,

 

I need to import two non-google fonts in Creatio to create emails: Avenir & Awesome. How can we do this in Creatio?

 

Thanks

Like 1

Like

2 comments

Hello,

 

To upload new fonts and use them in emails, you need to change the values of the system settings "CKEditor fonts list" ("CKEditor fonts list") and "CKEditor default font" ("CKEditor default font"). 

The "CKEditor fonts list" system setting is responsible for which font you will be able to see in the font drop-down list. It should be added to the beginning of the system setting list, with ";".

Accordingly, in order to use this font, they just need to be installed on the server as a regular font.

It is also necessary to know that if the recipient does not have this font, he will not see this font.

 

Best regards,

Yuliya

Yuliya Gritsenko,

Thanks Yuliya; how do I install these fonts on the Creatio environment?

Show all comments

Hi, 

 

I'd liket to create a script task in a business process, that given an email template, it executes it on a specific context. I mean, if the email template is based on a custom macro related with the Lead entity, I can pass the LeadID and the emailTemplateId to the script task, and the result is the text of the email template executed for that specific lead. 



Is there way to do that?



Thanks!

Ignacio 

Like 0

Like

4 comments

Hi Ignacio,

 

You can pass LeadId and the TemplateId as process parameters (create two Guid parameters in the process settings). Then you can use the "Read data" element and read specific columns of the lead record (use the LeadId parameter in the "Read data" filtration to get the value for needed columns). Then you can create additional text parameters and pass the read column values to them (using formulas for example). The same approach is for the "Email template" object and TemplateId parameter (you need to get the template body, so you need to read it in the "Read data" process element). And finally you can use string interpolation (or String.Replace method) in the script task to replace macroses (macorses, not their values, like [#UsrSomeColumn#], it's passed in the template body) with the actual values read from the "Lead" object using the "Read data" element (the ones that we wrote to the process parameters). To get process parameters values in the script task you need to use Get<string>("ParameterCode") (see more examples here) construction in the script task, then you can use String.Replace in the following manner:

string UsrStringParameterValueToUse = Get&lt;string&gt;("UsrStringParameterValue");
string EmailTemplateBody = Get&lt;string&gt;("UsrEmailTemplateBodyParamter");
EmailTemplateBody= EmailTemplateBody.Replace("[#UsrSomeColumn#]", UsrStringParameterValueToUse);

And then you can return EmailTemplateBody to some another string parameter value using Set<string> command and as a result you will get the result needed.

Thank you for your response Oleg!

 

Right, that would be the "manual" approach. I was hoping I could reuse the same service that is being used when creating an email from a template. For example, I can use a ReportService to generate a printable inside a business process. I was hoping that we have in Creatio something like "EmailService" that processes an email template and returns the generated text.

Pavel Shkomov,

 

You need to use the script-task to send the email from the code directly. Please see this Academy article that describes how to form and send the email from the code (this article also have examples of implementations, please use the "Examples" tab at the top of the article).

Ignacio Alvarez,

 

there is another approach:

var macrosHelperClassFactory = ClassFactory.Get&lt;MacrosHelperV2&gt;(new ConstructorArgument("userConnection", UserConnection));
 
string emailTemplateCode = Get&lt;string&gt;("ResultEmailTemplatePlain");
string templateEntityName = Get&lt;string&gt;("ContactEntityName");
Guid templateEntityId = Get&lt;Guid&gt;("ContactRecordId");
 
var replacementResult = macrosHelperClassFactory.GetTextTemplate(emailTemplateCode, templateEntityName, templateEntityId);
Set&lt;string&gt;("ResultEmailTemplateHTML", replacementResult);
return true;

There should be also the following parameter values:

1) the code is ContactEntityName - Text (50 characters) data type ("Contact" value by default) - represents the object from which data for macros is selected

2) the code is ContactRecordId - Unique identifier data type - represents the record Id to get data for macroses

3) the code is ResultEmailTemplateHTML - Unlimited length text data type - contains the template with filled macroses

4) the code is ResultEmailTemplatePlain - Unlimited length text data type - contains the template without filled macroses

 

Also you need to add the following namespaces to the process usings:

Terrasoft.Configuration.Utils

Terrasoft.Core.Factories

 

You need to use the "Read data" process element and read specific email template (the object is "Message template") and you need only the "Body" column value. Then the read body of the template should be passed to the "ResultEmailTemplatePlain" parameter using the "Formula" process element.

 

As a result of the script-task process element you will get the formed email template body with filled macroses in the ResultEmailTemplateHTML parameter that can be then displayed for example using the autogenerated page.

Show all comments

Hi Community!

 

I have a requirement to add fields for multiple records from the connected detail along with fields from the macro object (1:M Relation). Can anyone suggest how to achieve this task?

 

Thanks & Regards,

Kritika Vari

Like 0

Like

1 comments

Dear Kritika,

 

Thank you for your question.

 

Unfortunately, your business task can be achieved neither with basic nor with advanced tools. 

We have already registered the idea for our R&D team to implement this functionality in further releases. 

 

Best regards,

Anastasiia

Show all comments