- Issue created by @joshuautley
- π©π°Denmark ressa Copenhagen
Did you verify that these tokens exist? You should be able to see all available tokens under
/admin/help/token
if you have both Token and Help installed. - Status changed to Needs work
9 months ago 12:21pm 19 February 2024 - π©π°Denmark ressa Copenhagen
I tried creating a "First name" field, and it is indeed:
First name: [simplenews-subscriber:user:field_first_name]
So the bug is confirmed :)
- π©π°Denmark ressa Copenhagen
You're welcome, though I guess I only confirmed that the token seems to exist, and ought to work ... Maybe you can try a whole swathe of tokens, including regular tokens such as site name, and see if none, or some work?
- πΊπΈUnited States joshuautley
Well, it would help if I entered a first name for my admin account. Doh!
I just sent a test to five different emails and noticed that the emails sent to everyone other than my admin account worked just fine. Since the admin account already existed before I added the First Name field I had neglected to enter a value.
Here are the tokens that do work...
Account Name: [simplenews-subscriber:user:account-name]
Display Name: [simplenews-subscriber:user:display-name]
First Name: [simplenews-subscriber:user:field_first_name]
Text Value: [simplenews-subscriber:user:field_first_name:value]This is the token that doesn't work... (which I don't need, I just threw it in there)
Corresponding user: [simplenews-subscriber:user]
So, this is not a bug and it works as designed.
Apologies.
- Status changed to Closed: works as designed
9 months ago 6:48pm 19 February 2024 - π©π°Denmark ressa Copenhagen
Heh, I know that feeling very well :) I have often spent far too long trying to get something to work, but failing because I was editing the wrong file, or assuming something should work (wrongly) like you did. I do try to "start small" now, and get something very basic to work, before moving on.
But at the least, it's great to get conformation that tokens work in Simplenews.
By the way, if you're using DDEV, you probably know about Mailpit, which is an awesome tool for email debugging and testing. If not, I warmly recommend it.
- πΊπΈUnited States joshuautley
I once worked with a great programmer in the late 90's / early 2000's who went by "Jello", his DJ name. When we worked on some DoD contracts I was doing a lot of ActionScript (Adobe Flash). I'd run to him with all these things and he'd stop me. He'd then say, start with one little thing, then once that's working move on to the next. Very valuable advice.
I've got everything working on this project now except keeping the emails out of the Spam/Junk folders. I've worked on some University projects in which I used Sendgrid and that worked great, but for this project, we're hoping to just use this site and now third-party services.
Thank you for the Mailpit tip, I've not heard of that resource before. I do not use DDEV either. I'm on a VPS as a one-man army helping out a friend on this one. I appreciate your help. So, far Simplenews is a great module and you've provided five-star support!
- π©π°Denmark ressa Copenhagen
Thanks for sharing, and I also remember Flash. I once interned in a company, who were building a medical information web site in Flash. Ouch. It was so slow, and updating anything was a big pain. I do like the "Jello" approach :)
I recently built a newsletter template in Simplenews, and used Postmark for sending email. In this day and age, many servers get blacklisted, sadly. If the volume is low (less than 100 emails every month) Postmark is free. I documented one way to set it up with Drupal Symfony Mailer:
https://www.drupal.org/docs/contributed-modules/drupal-symfony-mailer/fa... β
You ought to check out DDEV, it's an awesome tool. And like I wrote, it can intercept email, and let you preview, see the source, validate, etc. Though for the Postmark set up, during testing I switch the transport to the default (SMTP/Sendmail). When I then want to let an email go through and actually get sent, I switch the default to Postmark, since they are not intercepted by Mailpit in DDEV.