How i can send variables for Sengrid template
Closed this issue · 2 comments
zeeshangulzar commented
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.
paveltyk commented
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:'')
zeeshangulzar commented
substitute '%name' , 'Test Name'
worked. Thanks