Hello 😉
I’d like to show a coupon code on the welcome page and send that coupon in the welcome e-mail as well.
I use such shortcode in welcome message template: [generate_newsletter_coupon email="{email}"]
So the subscriber’s e-mail is passed to the shortcode as attribute and everything works great.
The same shortcode in welcome e-mail template doesn’t work as expected. The “{emial}” string is passed to the shortcode instead of an actual e-mail address.
Hi, that behavior is correct, shortcodes are executed once not per subscriber. But with this little code sample, you can add a filter to get the code executed per subscriber:
Sorry, I said the wrong thing: the shortcode should be executed per subscriber, are the shortcodes enabled on Newsletter’s main settings? If so and still they’re not executed, it means they’re not registered in the admin context… they would work on a real delivery since the delivery is executed in the “scheduler” context, but the code sample is even more “secure”.
Shortocdes are enabled. I gave a try this code snippet but newsletter_message filter doesn’t seem to be triggered when the welcome email is sent. {coupon} tag string in the welcome email template is unaffected. I’ve tried to change the filter’s priority with no luck 🙁
//edit
newsletter_replace filter works like a charm!