Hey,



I'm trying to implement business task when we need to send a datalist/table in email template.

I was surfing the academy and came into this https://community.creatio.com/questions/how-display-datalist-email-template 



But i faced a little problem,

When inserting my macros to email template, the message itself not recognizing the html code.



Any suggestions how to fix it? 

Thanks

Like 0

Like

6 comments
Best reply

Oleksii Protsiuk,

 

Hello,

 

&amp;lt; means that there should've been < in the code. I believe there is an issue with the html code translation in your template. You need to replace:

 

&amp;lt; with <

&amp;gt; with >

&amp;gt with > either

 

using Notepad++ replacement for example (I've modified the code you sent using this text editor). As a result I received a correct code, but after that the HTML should be checked. This can be done via the tests in Visual Studio and receivig the HTML code result and verifying it for example here. You can use some test values instead of entity.GetColumnValue(colPercentage.Name).ToString() to verify the code.

Dear Oleksii,

 

Thanks for reaching out.

 

Could you please provide us an example of macros you are trying to insert into your email template?

 

Thanks in advance. 

 

Best regards,

Anastasiia

Anastasiia Marushenko,

namespace Terrasoft.Configuration
{
	using System;
	using Terrasoft;
	using Terrasoft.Common;
	using Terrasoft.Core;
	using Terrasoft.Core.Entities;
	using Terrasoft.Core.DB;
	using Newtonsoft.Json;
 
	public class NewEmailMacros : IMacrosInvokable
    {
        public UserConnection UserConnection {
            get;
            set;
        }
        public string GetMacrosValue(object arguments) {
//        	var sjson = JsonConvert.SerializeObject(arguments);
//        	var templ = new {Key = String.Empty, Value = String.Empty};
        	var currencyId = "c1057119-53e6-df11-971b-001d60e938c6";
        	var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, “Object"); 
            var colCode = esq.AddColumn("Column1"); 
            var colPercentage = esq.AddColumn("Column2"); 
            var colCurrency = esq.AddColumn("Column3");
            var colType = esq.AddColumn("Column4");
            var colDate = esq.AddColumn("Column5");
	        var colDay = esq.AddColumn("Column6"); 
          	var CurrencyFilter = esq.CreateFilterWithParameters(
    		FilterComparisonType.Equal, "Column3.Id", currencyId); 
	          esq.Filters.Add(CurrencyFilter);
           EntityCollection entities = esq.GetEntityCollection(UserConnection);
 var html = "&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Percentage&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;th&amp;gt;Code&amp;lt;/th&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Currency&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Type&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Date&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Day&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt";
            foreach (Entity entity in entities) {
 	          	html += "&amp;lt;tr&amp;gt;";
 	          	html += "&amp;lt;td&amp;gt;" + entity.GetColumnValue(colPercentage.Name).ToString() + "&amp;lt;/td&amp;gt;";
            	html += "&amp;lt;td&amp;gt;" + entity.GetColumnValue(colCode.Name).ToString() + "&amp;lt;/td&amp;gt;";
     	      	html += "&amp;lt;td&amp;gt;" + entity.GetColumnValue(colCurrency.Name).ToString() + "&amp;lt;/td&amp;gt;";
      	     	html += "&amp;lt;td&amp;gt;" + entity.GetColumnValue(colType.Name).ToString() + "&amp;lt;/td&amp;gt;";
         	  	html += "&amp;lt;td&amp;gt;" + entity.GetColumnValue(colDate.Name).ToString() + "&amp;lt;/td&amp;gt;";
				html += "&amp;lt;td&amp;gt;" + entity.GetColumnValue(colDay.Name).ToString() + "&amp;lt;/td&amp;gt;";
            	html += "&amp;lt;/tr&amp;gt;";
            }
				html += "&amp;lt;/table&amp;gt;";
            	return html;
        }
    }
}

 

Anastasiia Marushenko,

I dont know why it kept changing the code, and adding the amp*

html += "&lt;/table&gt;";

 

 

Oleksii Protsiuk,

 

Hello,

 

&amp;lt; means that there should've been < in the code. I believe there is an issue with the html code translation in your template. You need to replace:

 

&amp;lt; with <

&amp;gt; with >

&amp;gt with > either

 

using Notepad++ replacement for example (I've modified the code you sent using this text editor). As a result I received a correct code, but after that the HTML should be checked. This can be done via the tests in Visual Studio and receivig the HTML code result and verifying it for example here. You can use some test values instead of entity.GetColumnValue(colPercentage.Name).ToString() to verify the code.

Oleg Drobina,

Thank you very much!

That helped.

You can use the Enhanced template macros for Creatio app from Marketplace.

You won't need to write additional code.

https://marketplace.creatio.com/app/enhanced-template-macros-creatio

Show all comments

Creatio Community,

 

Is it possible to format a custom macro field on an email template? I need to display a date with the long format date on an email (eg. August 25, 2022) 



The email definition that has the date looks like this:



The details of this fee were [#UsrPatientContactPreference.UsrEmailText#] to the patient or dispute submitter, on [#UsrRequestForAdditionalInformationSentOn#]



The  last field is the one I need to format.

 

Thanks,

Jose

Like 0

Like

1 comments
Best reply

Hi Jose,

 

Unfortunately, of now, there is no such functionality, but our R&D already has plans to implement it in future versions of Creatio!

 

As a workaround you can add a macro handler into the template:

https://academy.creatio.com/docs/developer/application_components/email…

Hi Jose,

 

Unfortunately, of now, there is no such functionality, but our R&D already has plans to implement it in future versions of Creatio!

 

As a workaround you can add a macro handler into the template:

https://academy.creatio.com/docs/developer/application_components/email…

Show all comments

Hi all,

 

I have a Email element in a business process that uses macros.

Made changes in the format of a date variable used in the email.

But, changes are not reflecting.

(Save, Publish, compile done)

 

Please advise.

 

Regards

Like 0

Like

1 comments

Hello Anitha,

 

Kindly contact our technical support team at support@creatio.com for us to take a closer look at the issue.

 

Thank you,

Anastasiia

Show all comments

Hello,

 

How may I suppress merge fields in templates where there is no data. For example in the below, the Lead does not have data in Address 2.



Word reports easily accommodate this however, how may I handle this with email templates?

 

Using Studio/Sales vrs: 7.18.5.1500

Like 0

Like

8 comments

Hi Thomas,

 

Unfortunately, it is not possible to achieve this in the current version of the application.

We have a task for our R&D team to have an option to display an empty string instead of the macros code on the yellow background so it will be added in future updates.

 

Best regards,

Max.

Max,

Really disappointing that a basic problem like that that has been solved by other products for years was missed here. This can make using email templates completely unreliable.



Thanks for the reply. Is there a comprehensive list of what does not work and what is in the backlog on being worked on?

You are able to do it. Basically, you create two different blocks.

One showing the row with the Address and one without.



Then use Rules & Dynamic content to show the appropriate Block for every Contact.

 

Perhaps this method only'll work for Bulk and Campaign Emails. I'm note 100% sure. But you can try!

Julius,

 

I appreciate your creativity here. I believe that using dynamic content requires the Marketing Module which we have yet to implement.



Tom 

Try navigating to the Email Templates section under the Studio Workspace. Maybe you don't have the new Email Designer? Marketing licences may be required for this? What Creatio version do you use?

I think it'll work on 7.18.3 and newer

We use the latest cloud version, I created the templates in Studio but we do not have the marketing module. Dynamic content should work however, these are basic user follow up emails and this issue should not even exist in 2022. Our users will need to review and delete these empty fields which is inefficient and disappointing.

 

I appreciate your knowledge and assistance.

 

 Tom

Max,

 

Or anyone at Creatio who can help with this... clearly there is a function #deleteifempty# which is included in one of your base sample templates, "Template for new invoice approval notification (US)".



I need someone to explain how this works, I tried the code in HTML and it did not work, instructions please!!!



Thomas Colby,

 

Were you able to find a solution? we are having the same requirement with no success to how it can be achieved.

 

Thanks,

Show all comments

Hello community,

 

We have a use case where a lead owner needs to perform certain approval tasks. The task can be approved or rejected. Is it possible to send an email to that contact with approved, rejected buttons and store the result of whichever button the email recipient clicked in creatio?



 

Like 0

Like

2 comments

Hello Shivani,



Unfortunately, it is impossible to implement your business task, as for now.



But we have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project in order to increase its priority.  



Best regards,

Bogdan

Bogdan,

Thank you Bogan. I was wondering if this could be replicated using OOTB Case feedback process which sends the satisfaction smilies. If we tried tot replicate this, would we require a SysPortal user license??

Show all comments



It can be really great to have the possibilty to choose one field of one detail as a macro for one email template, currently we have to create a source code for any field for which we want to place in the email template.

4 comments

Dear Marvyn, 



Can you please provide us with more details on your idea? 

We would like to have a better understanding of functionality you would like to see in Creatio. 



Kind regards,

Roman

Roman Brown,

Of course, let's me explain the idea:

When we are creating an email template we have the possibilty to select basic or custom macro in order to personalize the email for each contact, but when we are selecting custom macro we don't have the possibility to select one detail (so one object) which is linked to the contact.

An example just below :

 

This is a free trial platform, and in this platform we have the contact in which we have some details like : Job Experience

 

 

And when we are creating an email template, and choose custom macro we don't see the detail (so the object with which this detail was created) and we don't have the possibilty to choose one field of this detail.

 

 

As you can see there aren't any possibilities to choose "Job experience" so this is this idea which i want to put the light on.

 

Thanks a lot Roman.

 

Hello Marvyn, 



Thank you for proposing this idea. 

We already have a similar request for extending this functionality in Creatio registered for the responsible R&D team. 

We will add this idea to their backlog so to increase it's priority. 



Kind regards,

Roman



 

Martin Büchler,

Good afternoon,

Unfortunately, the idea is still under development, we do not set a time frame for its implementation and start from their priority.

I raised the priority of the idea by adding your appeal to it, so this feature may appear faster in future versions.

Show all comments

Hi Community,

 

I have a decimal field "UsrGrandTotal". I am showing this field in my word printable. How can I format the value of my field as  below:

 

Value: 2415.00

Must show as like this: 2,415.00

 

I found below link in academy but the problem is that, If the fractional part is zero, it will not be displayed. I need to show both the comma delimiter and the fractional 0 in 2 digits

https://academy.creatio.com/documents/technic-sdk/7-16/basic-macros-ms-…

Like 0

Like

3 comments

Dear Fulgen,

 

It’s possible to create a custom macros if there is no basic macros that would suit your business task. Please find the example of creating the custom macros in the article by the link below:

 

https://academy.creatio.com/documents/technic-sdk/7-16/how-create-macros-custom-report-word

 

Best regards,

Norton

I have an article with a sample here that is pretty close to what you're after, this custom macro will format money as $2,415.00 (based on the culture in the macro). You can see this article here https://customerfx.com/article/creating-custom-macros-to-format-values-in-word-printables-for-creatio-formerly-bpmonline/ You could use it as a starting point for yours and just replace the line

result = currency.ToString("C", new CultureInfo("en-US"));

to something like this

result = number.Format("{0:n}");

Ryan

Ryan Farley,

 Thanks Ryan, helps a lot!

Show all comments

I have some strings in email template, separated by Newlines:

Text1
 
Text3

 

Depending on a condition, Text2 could be added between:

Text1
 
Text2
 
Text3

 

To achieve this, I add [#UsrText2#] custom macros field of type string:

Text1
 
[#UsrText2#]Text3

 

But I can't can't make [#UsrText2#] contain NewLine. So result is:

Text1
 
Text2Text3

 

Email is sent with business process automatically.

How could I add a Newline? Neither Environment.NewLine nor \r\n, \n work.

Text1 and Text3 could also be dependent on conditions, so I don't want multiple templates for different combination of conditions.

Like 0

Like

5 comments
Best reply

Amazing!

Solved with <br/>

 

Yes. You make different Blocks.

Then you show the Block that matches the recipients information.

One block is

Text1   [#UsrText2#] Text3

Next block is

Text1   Text2 Text3

Then you just set them up so either one or the other is used with conditions.

Dear Yuriy,

 

If this email is sent via business process it will be easier to just create several conditional flows based on record conditions and create a template for each condition. Since there is no option to set up dynamic HTML in the template this will be the best option.

 

Best regards,

Angela

Angela Reyes,

This is what I'm afraid of. We have a minimum of 2 conditions. They will give 4 different templates. If one more condition is added, there will be 8 templates and 8 flows. But we really need these lines separated by newline. Each optional string needs to have 2 Newlines. This is the desired result:

Text1
 
Text2(optional)
 
Text3
 
Text4(optional)
 
Text5

What I get currently:

Text1
 
Text2Text3
 
Text4Text5

 

Julius,

Thank you Julius, I didn't say, email is sent automatically with a business process.

Amazing!

Solved with <br/>

Show all comments

Good day folks, 

 

How is it possible to capture "Current Date" to use in an email template? does it require HTML or Creatio offers macro for that purpose?

Like 1

Like

1 comments

Hello,

 

You need to create a process parameter like on these screenshots https://prnt.sc/rqteet -> (here you need to specify "Formula" value) https://prnt.sc/rqtf1u and use this parameter as a macro in your email template https://prnt.sc/rqtfpg and https://prnt.sc/rqtfz1. As a result, email received will contain current date and time (at the moment of email sending).

 

Best regards,

Oscar

Show all comments

The functionality of custom messages in the Send email system action changed recently.  When I click in a text box and select Custom macro, I get the following error:

It used to just give me the same selections as for a function. I want to reference the process parameters, not an entity. How do I specify an entity for column selection or access the process parameters? Also, the Yes/No buttons make no sense here because it's not a question.

Like 0

Like

3 comments

Hello,

Our developers are currently working to resolve this problem in all applications. I'd suggest you to approach our support team via support@creatio.com to get this issue fixed on your website. 

Best regards,

Dean

Hi Dean is there a resolution to this issue in the last 2 years? I am trying to make a macro in a template and cannot

 

Dear Heather,

 

Thank you for your question!

 

The website needs to be recompiled in order for the changes to be applied.

 

Hope this helps!

 

Thank you!

 

Danyil

Show all comments