cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Alert and notification

adityaku
1-Visitor

Alert and notification

Hi ,

I want to send an alert in the following format to the recipient. We are using mail server extension

Dear abc@gmail.com,


An alert has been triggered from gmail which requires your attention. Please see below for details of the alert.


king: abc

Rose: abc fdeg


asdf: First Pass

Met: <40%

trpu: 32%

Time: 2016-July-12 11:15:01

Recipients: abc@gmail.com,def@gmail.com


This is an auto-generated email  that does not accept responses. For more detailed information, login to sc.abc.com/*aditya. If you require additional help, please reach out to your leader or submit a ticket here.

Thanks,

Aditya Kumar

11 REPLIES 11

Please give the answer asap.

Aditya,

Please provide additional information on what you are trying to do and what you have implemented thus far. Have you created the Alert yet, have you constructed the custom service that will generate that message in that format? Where are you trying to pull those values from you've cited in the message?

Thanks,

Meghan

Hi Megan,

Yes we have created the alert and the alert is also going. We were only sending "Alert" to the recepients.

But, now we have to send all the below details:

Dear abc@gmail.com,


An alert has been triggered from gmail which requires your attention. Please see below for details of the alert.


king: abc

Rose: abc fdeg


asdf: First Pass

Met: <40%

trpu: 32%

Time: 2016-July-12 11:15:01

Recipients: abc@gmail.com,def@gmail.com


This is an auto-generated email  that does not accept responses. For more detailed information, login to sc.abc.com/*aditya. If you require additional help, please reach out to your leader or submit a ticket here.

That to in the same format mentioned above.

Font should also be same. How to configure in the service

The body of a message accepts HTML markup, so use the following as the markup:

<div class="jive-rendered-content"><p>Hi Megan, </p><p style="min-height: 8pt; padding: 0px;"> </p><p>Yes we have created the alert and the alert is also going. We were only sending "Alert" to the recepients.</p><p style="min-height: 8pt; padding: 0px;"> </p><p>But, now we have to send all the below details:</p><p style="min-height: 8pt; padding: 0px;"> </p><div style="margin: 0 0 20px; font-weight: inherit; font-style: inherit; font-size: 0.8889em; font-family: inherit; color: #999999;"><div class="j-column-wrap-l" style="font-weight: inherit; font-style: inherit; font-family: inherit;"><div class="lg-margin j-column j-column-l" style="margin: 0 218px 40px 0; font-weight: inherit; font-style: inherit; font-family: inherit;"><div class="jive-thread-messages" style="margin: 0 0 40px; font-weight: inherit; font-style: inherit; font-family: inherit;"><div class="jive-thread-info clearfix j-rc4" style="margin: 0 0 20px; padding: 15px; font-weight: inherit; font-style: inherit; font-family: inherit; background: #f6f6f6;"><div class="j-thread-post j-rc4" style="margin: -1px 4px -1px -1px; padding: 8px 16px 4px; border-top-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #bebebe; border-bottom-color: #bebebe; border-left-color: #bebebe; font-weight: inherit; font-style: inherit; font-family: inherit; background: white;"><p style="min-height: 8pt; padding: 0px;"> </p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 29.4658px; font-family: inherit;">Dear </span><a class="jive-link-email-small" href="mailto:abc@gmail.com" style="font-weight: inherit; font-style: inherit; font-size: 29.4658px; font-family: inherit; color: #3778c7; text-decoration: underline;">abc@gmail.com</a><span style="font-weight: inherit; font-style: inherit; font-size: 29.4658px; font-family: inherit;">,</span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><br></span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;">An alert has been triggered from gmail which requires your attention. Please see below for details of the alert.</span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><br></span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><strong style="font-style: inherit; font-size: 30.2213px; font-family: inherit;">king:</strong> abc</span></p><p style="min-height: 8pt; padding: 0px;"> </p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><strong style="font-style: inherit; font-size: 30.2213px; font-family: inherit;">Rose:</strong> abc fdeg</span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><br></span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><strong style="font-style: inherit; font-size: 30.2213px; font-family: inherit;">asdf:</strong> First Pass</span></p><p style="min-height: 8pt; padding: 0px;"> </p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><strong style="font-style: inherit; font-size: 30.2213px; font-family: inherit;">Met:</strong> &lt;40%</span></p><p style="min-height: 8pt; padding: 0px;"> </p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><strong style="font-style: inherit; font-size: 30.2213px; font-family: inherit;">trpu:</strong> 32%</span></p><p style="min-height: 8pt; padding: 0px;"> </p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><strong style="font-style: inherit; font-size: 30.2213px; font-family: inherit;">Time:</strong> 2016-July-12 11:15:01</span></p><p style="min-height: 8pt; padding: 0px;"> </p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><strong style="font-style: inherit; font-size: 10pt; font-family: inherit;">Recipients:</strong><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 30.2213px; font-family: inherit;"> </span><a class="jive-link-email-small" href="mailto:abc@gmail.com" style="font-weight: inherit; font-style: inherit; font-size: 30.2213px; font-family: inherit; color: #3778c7;">abc@gmail.com</a><span style="font-weight: inherit; font-style: inherit; font-size: 30.2213px; font-family: inherit;">,</span><a class="jive-link-email-small" href="mailto:def@gmail.com" style="font-weight: inherit; font-style: inherit; font-size: 30.2213px; font-family: inherit; color: #3778c7;">def@gmail.com</a></span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"><br></span></p><p style="font-weight: inherit; font-style: inherit; font-family: inherit;"><span style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;">This is an auto-generated email  that does not accept responses. For more detailed information, login to sc.abc.com/*aditya. If you require additional help, please reach out to your leader or submit a ticket here.</span></p></div>

Hi Meghan,

I have tried writing a service using the above code.

In the service,I have assigned the above code to the variable result and declared the output as HTML.

But,I receive a syntax error and also the closing tags like </p> are highlighted in red.

Please suggest a remedy.


Thanks,

Aditya

Hi Aditya,

You can't write HTML code directly on the scripting box, you should write it on a String, something like this:

var myHTML = "<html><head></head><body>\

<h1>Title</h1>\

Content bla bla bla <i>italic</i>\

</body></html>";

the use myHTML to pass as the parameter on the mail extension.

Exactly.

Thanks Meghan and Carles.

It is working now.

wahmed
3-Newcomer
(To:adityaku)

Hi Aditya,

How did you manage to configure your alert to send messages? Please explain. I created an alert on a property. And my mail is also configured.

Thanks,

Wasim

ankigupta
12-Amethyst
(To:wahmed)

Hi Wasim Ahmed​,

Create a subscription to subscribe to this alert. In the Subscription code; use the SendMessage service of the mail Thing to send the mail.

Do let me know if you face any issue.

Announcements


Top Tags