Make template region optional

Created on 18 June 2021, almost 4 years ago
Updated 17 April 2025, 9 days ago

Problem/Motivation

Currently, when setting up a template map, it is mandatory to select a template region for the main content to be added to. However, in our use case, the client actually likes to define the bulk of the mail in the template, and only have Drupal fill in placeholders. This is totally possible with the merge functionality of Mandrill, but it does require a bit of a strange back-and-forth; we add a dummy region to the template when configuring it in Drupal just to be able to select a template area, and then later remove it, because we are not actually interested in the main Drupal content.

Steps to reproduce

  • Create a template in Mandrill with no mc:edit regions (add some Handlebars placeholders, if you like).
  • Try and configure the template map in Drupal
  • Notice that the module will not allow you to safe

Proposed resolution

I get that making the template region mandatory makes the module more fool proof; users will not be able to make a configuration that does not work, essentially. I would propose to add a checkbox that says "Only use merge variables". When checked, this would allow the config to be saved without selecting a template region. It could have a description saying 'When using this option, the mail content from Drupal will not be used. You will need to ensure appropriate placeholder values are present in $message['params']['mandrill']['overrides']['mandrill_template_content'].'

Remaining tasks

  • Create a merge request
  • Review
  • Merge

User interface changes

Not configuring a template region will be allowed.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands eelkeblok Netherlands 🇳🇱

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom Rob230

    Need this as well... our client has email templates that don't have a "body" section, but rather multiple fields to be filled in a structured email.

    This is possible with Mandrill, but this module assumes you have a single region to choose. So you have to add a dummy region in order to be able to save.

Production build 0.71.5 2024