paveltyk/sendgrid-rails

How i can send variables for Sengrid template

Closed this issue · 2 comments

template_id("sendgrid_template"); mail(subject: 'Welcome to Example Company', to: user.email, from: 'test@example.com', body:'')

And i have following template at sendgrid

Dear %name%,
Welcome to the example company

Lorem ipsum is testing text.

Hi, @zeeshangulzar

Can you try this?

template_id('sendgrid_template')
substitute '%name%', ['John Doe', 'Will Smith']
mail(subject: 'Welcome to Example Company', to: %w[user1@example.com user2@example.com], from: 'test@example.com', body:'')

substitute '%name' , 'Test Name' worked. Thanks