Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to set the language of a mail template from NotificationUtil?

Hi experts!

I've been having some issues with the Message Template Language when using the NotificationUtil to send an Email.

How do I set the language of the template?

Do i set this by the sender? Or do I need to reference the recipient?

If so, how could I get the Account Object Interface from the user given that I got him as a collaborator?

I wish you could help me out whit this language problem.

Here's an example of the code I'm using:

Properties params = new Properties();

params.put(new String("PHASE_NAME"), faseName);

params.put(new String("DOCUMENT_TYPE"), docType);

params.put(new String("DOCUMENT_NAME"), contractName);

params.put(new String("OWNER_FIRST_LAST_NAME"), owner.toString());

params.put(new String("START_DATE"), fecha);

params.put(new String("INSTRUCTION"), "");

params.put(new String("DOCUMENT_HEADER_URL"), vinculo);

String[] recipients = {mail};

sender = session.getAccount();

mailTypeEnum = new MailTypeEnumType(MailTypeEnumType.ODP_WORKFLOW_APPROVAL_REQUEST_MSG);

NotificationUtil.sendNotification(recipients,sender, mailTypeEnum,params,null,null);

Thanks in Advance!

Tags:
Former Member
replied

Hi Oscar,

There are 2 flavors of the sendNotification method, one takes IapiAccountIfc for recipient and the other takes a String array for recipients. Looks like you are using the one that takes a String array by passing a list of recipients email id. I'd suggest using the first one by passing the IapiAccountIfc for the recipient and the email sent out will be in the default language of that user. The default language for the user is set on the user account object.

Hope this helps.

Regards,

Vikram

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question