Skip to main content
Solved

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


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

View original
Did this help you find an answer to your question?

4 replies

david_r
Celebrity
  • 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
  • August 2, 2019
david_r wrote:

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
  • August 2, 2019
f.kemminje wrote:

@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
  • 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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings