Page 1 of 1

SendGrid API - using template

Posted: Thu Jul 17, 2014 3:38 am
by Aeneas McBurney

How do I use a template mail item with the Appery API for Sendgrid? I want to use a template which will have company logo on and just add the message body and subject.


SendGrid API - using template

Posted: Thu Jul 17, 2014 3:56 am
by Yurii Orishchuk

Hi Aeneas,

Unfortunatly this is not specified with Appery.io platform.

You can use all JS templating processing which is you need.

Regards.


SendGrid API - using template

Posted: Thu Jul 17, 2014 4:07 am
by Aeneas McBurney

Hi Yurri,

How do I use JS templating to do this? I am quite new to js. I basically just want to add a banner/picture at the tope of the email and send it in html.

Thanks,
Aeneas


SendGrid API - using template

Posted: Thu Jul 17, 2014 4:35 am
by Yurii Orishchuk

Aeneas,

I guess you can add this information to your body without templating.

Just concatenate strings with JS.

For example:

var body = "<h1Dear user,</h1";
body += '<Imagehttp://hereisyour.image.url" rel="nofollow"http://hereisyour.image.url/a"';
body += "<phere you can add some infor</p";

Then you can use this "body" variable in sendgrid.

Regards.


SendGrid API - using template

Posted: Thu Jul 17, 2014 4:39 am
by Aeneas McBurney

That's great thanks. How do I use this part

http://hereisyour.image.url

to refer to an image in the app media library? Can this be done?

Thanks,
Aeneas


SendGrid API - using template

Posted: Thu Jul 17, 2014 5:14 am
by Alena Prykhodko

You need to specify path to the image source.
For example "http://appery.io/app/view/95800416-80..."

You will need to make your app public to change appId.