Skip to content

EmailInfo TemplateParameters are ignored #1342

@avifatal

Description

@avifatal

Hi,
I think this is a bug.
I am setting the template params as the following: emailInfo.setTemplateParameters(Collections.singletonMap("name","test name"));
this is the body content emailInfo.setBody("<b>test ${name}</b>");
the email arriving is: <b>test ${name}</b> and not as expected <b>test name</b> ;

Could it be that TemplateParameters is ignored when no providing template path?

thanks

            EmailInfo emailInfo =
                    new EmailInfo(
                            customer.getEmail(),
                            "test@gmail.com",
                            "My subject",
                            "");
            emailInfo.setCaption("Subject");
            emailInfo.setFrom("myemail@gmail.com");
            emailInfo.setBodyContentType("text/html; charset=UTF-8");
            emailInfo.setBody("<b>test ${name}</b>");
            emailInfo.setTemplateParameters(Collections.singletonMap("name","test name"));
            try {

                this.emailService.sendEmail(emailInfo);
            } catch (EmailException e) {
                e.printStackTrace();
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions