Home › Toolset Professional Support › [Resolved] Question about sending views output to newsletter subscribers
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
Tagged: Views, Views plugin
This topic contains 9 replies, has 2 voices.
Last updated by nicolaS-3 4 years, 3 months ago.
Assisted by: Nigel.
Hi,
I'm trying to send output from a query/view into an email to newsletter subscribers, similar to how content is rendered on a page, but I didn't manage to find any newsletter plugin that can do that. A few support CPTs and even less support shortcodes. I have one of the latter and I tried to place a test view shortcode and send an email, but only the HTML part is sent, not the content of the view, meaning that the view is not executed before sending the email. Do you have any suggestion about what I can do, any newsletter plugin that you know it works with Toolset or anything ? thanks
Regards
Nicola
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Nicola
I'm not aware of any such product, but then I'm not particularly familiar with the range of options available.
What I can say is that a newsletter email isn't somewhere you would normally encounter shortcodes, you'd likely need to explicitly pass the content filter over the newsletter content to parse shortcodes.
It sounds like you have a product that does that, yes? If you register a dummy shortcode to just output some dummy text, and you use that shortcode in the body of the newsletter, does the shortcode get replaced with the dummy text?
If you insert a wpv-view shortcode in the newsletter content, what appears in that place in the email? The unparsed wpv-view shortcode? Or partially parsed content, where the wpv-view shortcode is replaced by the output of the View, but the shortcodes that make up the output of the View are not themselves parsed?
Can you give me some more details?
Hi Nigel,
I have tried a few NL plugins: MailPoet, MailChimp and this one I am using now, The Newsletter Plugin (that happens to be Italian like me).
All offer an email editor, but sometimes you can just use the normal Post type, no CPTs. Or you can select a CPT (Pro version) but you can just use the standard post fields (title, content, featured image, author, taxonomies), no custom field selection (it doesn't make much sense but ...). Taxonomies are usually all supported. No one allows to use the page content as email content.
I need to send email updates to my newsletter subscribers including information from CPT fields, but no plugin I tested so far is currently capable to do this. I am in contact with the NL Plugin developers and they suggested to use shortcodes, which are supported. So I did, pls find the outputs, I am attaching some pictures for you to understand better:
1. the Newsletter plugin editor with the shortcode in a text block
2. how it is rendered on the test email when it arrives
3. how the content looks like on a page and should look like on the email (it has pagination, not shown).
On #3 the table headings are created in the view with HTML before the loop and the pagination is standard Toolset. It seems like the loop is not executed before the email content is created.
On #2 you see headings and pagination with added links (to what ?!?!?)
For this was just a test for the shortcode, I picked up any simple view I already had and used that. If the shortcode would work of course I'd prepare a special view for creating the newsletter content (raw texts, no pagination, filters to limit rows to be sent, etc).
Alternatively, I have thought to create a newsletter specifc CPT to be fed with the main CPT content: title=title, all custom fields content would go into the content as texts, and taxonomies would be the same. What do you think ? Can I create a view to feed another CPT ? would I need extra code ?
I think this topic could be of interest for many Toolset users.
Thanks
Kind regards
Nicola
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Nicola
I've installed the Newsletter plugin to try and do some testing, but I'm having problems getting it to work (at all) and I'm going round in circles.
I've created a newsletter and I think I've subscribed to it, but I can't work out how to send the newsletter to see what it generates.
The previews don't parse shortcodes at all, so I can't check what is expected to work.
Any tips you have please let me know.
In terms of your screenshots etc., I would say you shouldn't test this with pagination, or any other kind of interactive elements such as search filters, they cannot be expected to work in such a context, try testing with a simple View that just outputs post titles.
Hi Nigel
before sending an email you have to go to Settings/SMTP and fill the form with your SMTP settings. You can send a test email to chek if it works. Then go to Newsletters/Create newsletter, select responsive Drag&Drop Composer and create a new Simple Call to Action newsletter then Drag&Drop a new text field with the view shortcode. Then send it to yourself. Hope this helps.
Thanks
Regards
Nicola
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Sorry Nicola, for the life of me I can't get Newsletter to work, it won't send newsletters, and the previews don't parse shortcodes (although the Newsletter settings are set to allow shortcodes).
I've created a sandbox site which has Types, Blocks, and Newsletter installed.
I've registered a custom shortcode "[dummy]" which can be used to check that shortcodes are being parsed generally.
Could you please log in to the site and create a newsletter for testing?
You can log in with this link: hidden link
When you have the newsletter working so that I can send it, I can do some more testing.
Hi
I have set SMTP settings with mine and I received the test email no problem. You can use my settings but you'd better replace them with your email provider's settings, it will be faster. Then add your email and click "Send a test email to this address". If you receive the test email you are done.
I have created a LIST and associated your user to that. I see you have used demo@wordpress.com but I am not sure if you'd be able to receive emails to this generic address, better use a real email address you can check later.
I have created a test newsletter, placed a text that you will need to replace with your shortcode.
Then go to Newsletter | Edit | Next | Send, it should work ... I was able to have it working, I have received it at affiliati@.
Let me know.
thanks
Regards
Nicola
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Thanks for that.
It looks like you can't resend a newsletter, so I duplicated yours, added a test shortcode, and then tried to send.
It appears to just sit there, but maybe it is very slow.
I did manage to send and receive a test email when updating the subscriber email address to my own email.
I had to update the settings to be able to use shortcodes.
I'll try again tomorrow.
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Nicola
The email had landed in my inbox overnight with the dummy shortcode parsed, so I tried again just now having set up a View and included the wpv-view shortcode in the newsletter.
It worked correctly, as you should be able to see in the screenshot.
It's a simple View just outputting a list of results with some fields.
I expect there would be some limitations, as I said above, nothing interactive like pagination or filters, and given these are emails, no stylesheets, so to the extent that you need styling and such styles would need to be inline styles, which makes grid-like layouts complex but not impossible, as you cannot use the usual Bootstrap classes etc., and I imagine patchy support in email clients for things like CSS grid, so you should plan your View output with that in mind and keep it simple.
My issue is resolved now. Thank you!