Skip to main content
Solved

How to pass new line char to subscriber_content(fme server notification service)

  • August 1, 2019
  • 4 replies
  • 161 views

f.kemminje
Contributor
Forum|alt.badge.img+11

Hi Team,

I used fmeservernotifier transformer

My content of the email looks something like this...

 

region1 : 100 features

region2 : 200 features

region3 : 300 features

 

All the features counts are in attributes. And email should be formatted like above.

if all text strings are in one row/line it comes out good. But I need multi line texts.

I mean each line shows region and its count. But when I pass this to "subscriber_content", error happens and all my email subject line and content becomes bla bla....

if it is simple one line text string, then it comes out good. And if i try to insert newline char[\\n] like below...

(region 1 : @Value(count1) \\n region 2 : @Value(count2) \\n region 3 : @Value(count3) \\n )

 

My email structure collapses. How can I achieve multi line text email message.

 

Thanks

 

 

below string copied from fme knowledge base....

{

"email_to": "recipient@example.com",

"email_cc": "",

"email_from": "sender@example.com",

"email_replyto": "",

"email_subject": "This is a sample email",

"email_attachment": "\\\\\\\\\\\\myserver\\\\\\\\\\attachment.txt",

"subscriber_content": "Hello World"

}

Best answer by f.kemminje

Hi Farook,

 

I think the best way to achieve what you're after would be to format your email as HTML. You would then be able to use the break tag to create new lines/multiline email.

In the JSON message that you're sending to FME Server using the Notifier transformer you may need to add "email_format": "html" so that it doesn't send it as plain text.

 

 

Kind Regards,

Jen

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

david_r
Celebrity
  • 8394 replies
  • August 2, 2019

Try doubling the backslashes for the newline inside the JSON, for example:

(region 1 : @Value(count1) \\n region 2 : @Value(count2) \\n region 3 : @Value(count3) \\n ) 

 


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 189 replies
  • August 2, 2019

Try doubling the backslashes for the newline inside the JSON, for example:

(region 1 : @Value(count1) \\n region 2 : @Value(count2) \\n region 3 : @Value(count3) \\n ) 

 

@david_r No David It did'nt work . email came, and looks like this

firstline \n second line \n third line


david_r
Celebrity
  • 8394 replies
  • August 2, 2019

@david_r No David It did'nt work . email came, and looks like this

firstline \\n second line \\n third line

I'm not quite sure I understand the chain of events. Am I right in assuming that you're sending an email to FME Server containing newlines, and you want the triggered workspace on FME Server to handle those newlines?


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 189 replies
  • Best Answer
  • August 14, 2019

Hi Farook,

 

I think the best way to achieve what you're after would be to format your email as HTML. You would then be able to use the break tag to create new lines/multiline email.

In the JSON message that you're sending to FME Server using the Notifier transformer you may need to add "email_format": "html" so that it doesn't send it as plain text.

 

 

Kind Regards,

Jen