Override content of mail confirmation by node

Created on 26 August 2024, 4 months ago
Updated 28 August 2024, 4 months ago

Hi

How to override the body of mail confirmation by node ?

Thanks
Phil

πŸ’¬ Support request
Status

Active

Version

3.2

Component

Registration Confirmation

Created by

πŸ‡§πŸ‡ͺBelgium philalawst

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @philalawst
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    The easiest approach is to use any of the node tokens in your email body. For example you can have an email subject such as "Thank you for registering for [node:title]" and the email body can include node field tokens like [node:field_something_or_other]. This assumes your host entities are always nodes, which seems likely based on your post. Another approach is to write a custom module that subscribes to the REGISTRATION_ALTER_MAIL event - it gets passed the host entity (presumably a node for your case), so you could do your own replacements or alterations to the mail body using custom logic in PHP. When the event is fired by the confirmation email it has a mail tag you can check, to be sure you are altering the correct email.

  • πŸ‡§πŸ‡ͺBelgium philalawst

    thanks for your suggestions !!

    I'll work with the first approach

    Thanks

  • πŸ‡¬πŸ‡§United Kingdom jonathanshaw Stroud, UK
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024