Hi!

We have problems using the (native) macros in email templates.

When parameters are inserted, the system displays them in yellow and reports that they can not be used / found.

Does anyone have any idea how we can solve this?

Thank you!

Like 0

Like

1 comments

Hello,

Can you please provide us with step by step description on how do you add this parameter, do you add it in a basic template or into your custom template, which object is a macro source for this template, and please send us screenshots of the template and the resulted email.

Thank you in advance!

Best regards,

Oscar

Show all comments

I have this Email template using Lead object as base.

The macro for the Owner Email will not work, but the MobilePhone and other will work perfectly.

Template

Result:

Like 0

Like

1 comments

Dear Julius.

Indeed, such macros doesn't work in the out of the box version of the application. To resolve this issue, you need to perform these steps:

1.Replace Lead object to the Custom package

2. Fill in the value of the column Owner and set it 'Owner' http://prntscr.com/pbotc9

3. Publish the object and compile the system.

Best regards,

Dean

Show all comments

Hi,

I created a email template with a custom subject ([#Account#] - [#imdPedRamoSeguro#] - [#Number#]) but when the email is sent the subject allways changes to "RE: + Case Number".

How can I change this default value?

Thanks.

Best Regards,

Nuno Gonçalves

Like 0

Like

1 comments

Hello,

The subject line is formed with the help of hard-coded macros that belong to the base system schema EmailMessagePublisherPage. Regardless of the displayed template subject, the base logic works and the macros is populated using the case subject value http://prntscr.com/o6issp. If you want to change this logic you need to replace EmailMessagePublisherPage page and after that develop new logic, but unfortunately we don't have a practical code to share.

Our developers will add the option to change the subject in one of the further system versions, indeed, though there is no ETA for it yet. At the moment to change the subject you can change the case subject itself on the case page.

Best regards,

Oscar

Show all comments

Hi Community,

We are transferring changes from dev instance to prod instance through 'Export packages to archive' in configuration from dev and 'Installed Applications' on Prod. But we noticed one thing Printables and Email Templates were not transferred. Any idea how we can fix this issue?

Like 0

Like

1 comments

Hello Fulgen, 

 

Here is an example how to transfer the email template,

you shoukd just do it similarly:

1.For example I has first instance localhost:8001

I have created a template "Test" in lookup "Email templates" http://prntscr.com/n7t0if

2.Now the task is to correctly bind the template to the package EmailTemplatesTest

Binding can be added by pressing Add button http://prntscr.com/n7t2r5

3. Select object email message template and press OK http://prntscr.com/n7t5am

4. Setup the filter that will choose the correct records http://prntscr.com/n7t60h

For example, in my case, the record with specified Id will be bounded to the package http://prntscr.com/n7t6kd

(You can check what records meets the filter by pressing "Display data" button)

5. After template is binded, you should export package to the archive http://prntscr.com/n7t7sp



6. Install the package to another instance in installed applications section http://prntscr.com/n7tf5a 

7. Now the template is successfully transfered http://prntscr.com/n7thai 



FYI: If you will have problems with non english templates, try to bind to the package Email template localization object http://prntscr.com/n7t9es



Best regards,

Alex

Show all comments

Hello all,

How to display Data List in Email Template ? i used bpm ver. 7.12

Thanks

Like 1

Like

8 comments

Dear Vidya,

Since templates are based on HTML you can use HTML coding to form the template as you want. Below you may find more information about tables and lists in HTML:

https://www.w3schools.com/html/html_tables.asp

https://www.w3schools.com/html/html_lists.asp

To add HTML code to your template go to template designer -> HTML code (http://prntscr.com/m1ir8g)

Best regards,

Angela

Dear Angela,

I means how to retrieve looping a data from multiple row data to email template, maybe this picture can describe what i want...

That section show 6 row data, and than i want to show that all data in email template.. and configuration email template :

But the result is only last record showed in email. please advise...

vidya.dharma,

Hello,

We can recommend you to setup a printable with the data from a detail and then send it with the help of a business process. The example of the implementation is described below:

https://community.bpmonline.com/articles/generate-printable-and-send-it…

You can modify the process ,so it meets your requirements.

Best regards,

Matt

Hi everyone,

Vidya question is very important to us... and for most of the cases, a printable it's not the solution. Can you give us some more tips on HTML?

@vidya.dharma - did you find another solution?

Thanks,

Luis

 

 

luis.goncalves@imdigital.pt,

 

You can implement you business task by the means of business process. The idea is to add read data elements, which would retrieve needed data from particular records. Afterwards, use “send email” business element to combine data into email and send it. You can add a button on the section, or action to trigger the process. 

 

Please see the following article. You can use this example to select needed records and pass this info to business process to send email.

 

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-add-section-action-handling-selection-several-records

 

Regards, 

Anastasia

luis.goncalves@imdigital.pt,

One other way, although it's a bit more complicated, is by using a custom macro (https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-macro-h…).

For example, I made this a while back to show a filtered list of products on an order; the HTML is very simple, as it was a demonstration, but that can easily be edited with CSS as necessary.  You can see that 'arguments' is passed the record ID if you link the template to a record; the macro is then called by including [#@Invoke.UsrEmailProducts#] in your template.

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 UsrEmailProducts : 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 args = JsonConvert.DeserializeAnonymousType(sjson, templ);
        	var orderId = args.Value;
        	var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "OrderProduct");
            var colCode = esq.AddColumn("Product.Code");
            var colDescription = esq.AddColumn("Product.Name");
            var colQty = esq.AddColumn("Quantity");
            var colSpecs = esq.AddColumn("UsrSpecifications");
            var colColour = esq.AddColumn("UsrColour");
            var OrderFilter = esq.CreateFilterWithParameters(
			    FilterComparisonType.Equal, "Order", orderId);
			var ModifiedFilter = esq.CreateFilterWithParameters(
			    FilterComparisonType.Equal, "UsrModified", true);
            esq.Filters.LogicalOperation = LogicalOperationStrict.And;
            esq.Filters.Add(OrderFilter);
            esq.Filters.Add(ModifiedFilter);
            EntityCollection entities = esq.GetEntityCollection(UserConnection);
            var html = "<table><tr><td>Code</td><td>Description</td><td>Quantity</td><td>Specifications</td><td>Colour</td></tr>";
            foreach (Entity entity in entities) {
            	html += "<tr>";
            	html += "<td>" + entity.GetColumnValue(colCode.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colDescription.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colQty.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colSpecs.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colColour.Name).ToString() + "</td>";
            	html += "</tr>";
            }
            html += "</table>";
            return html;
        }
    }
}

Edit: All the </> should be proper lt/gt characters, that's just the forum software replacing them.

Hi Darian Lewis,

I'm working together with Luis Gonçalves, and we finally had some time to test your sugestion.

It is actually working perfectly, the table is created in the email in the context of the record ID and there isn't even any need to replace the "</&gt".

Thank you very much.

I've got one more question for you: this works fine if I start an email from the Case and the ID is passed perfectly.

But if I try to reply to an email that was sent by a costumer and the email is linked with that same Case. Then the conection does not work and the recordID is not retrieved. Any idea how I could make the conection between the macro and the case that is linked with the email that I'm replying to?

 

Once again thanks for the help.

Luis

Luis Tinoco Azevedo,

I'm afraid that's more of a back-end BPM thing; to the best of my knowledge, the 'arguments' argument ought to hold the current record, but as I'm not a BPM employee, I don't know what the mechanics behind it are.  It may be that the 'current record' when you're replying to an email is the Activity object representing the email instead of the Case object, but that's just a guess.  I don't know to what extent you're comfortable with the code, but have you tried temporarily returning the contents of the arguments variable (instead of the table) to see what's being passed in?

Show all comments

Current template system works for simple cases. With anything more complex and involving data from not directly related entities I feel forced to create custom "bag of values" entities, just for the purpose of sending an email or generating a document. There's also no easy way to add arbitrary variables to templates. I mean variables that are not connected with any entities, something like for example current date. I think it would help a lot if you could set up multiple "macro sources" and add arbitrary parameters too (just like you can create parameters for a business process).

1 comments

Hello.

We will register the following idea for our R&D team in order to enhance the functionality for he upcoming releases.

Thank you for your ideas!

Best regards,

Matt

Show all comments

Do you know how to create macros in BPM'online 7.12? I found this guide for 7.13: https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-macro-handler-email-template but in my case the interface IMacrosInvokable could not be found.

Like 0

Like

4 comments

Dear Carlos,

To get the IMacrosInvokable interface, you have to add it first, by adding source code to the schema of your development package. Please, refer to the paragraph 'Creating the class which implements the IMacrosInvokable interface' of the guide. 

Apart from that you can use your own templates that are quite convenient as well. More details are in this article:

https://academy.bpmonline.com/documents/administration/7-13/how-create-…

Regards,

Dean

 

Dean Parrett,

The problem is that the interface IMacrosInvokable can not be found, so my source code doesn't compile.

Dear Carlos,

If you receive the error 'IMacrosInvokable' could not be found' that means that most likely you are not using the Service application. This guide and functionality are developed for Service applications only and the interface IMacrosInvokable' is developed in CaseService package of the IMacrosInvokable schema. It might me the reason for this error. Our R&D team is working on implementation of this functionality in different products, so you may expect it in the upcoming versions of the application.

Best regards,

Dean

Dean Parrett,

Ok, thank you.

Show all comments