Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey guys!
Super module!
I used the regular embed code from Mailchimp before, but that gave our subscribers an extra email.
With this module that is not the case anymore. Cool.
The only downside is that I cannot add a language to the email address, which is inconvenient when on a multilingual website.
It only gives me options:
MERGE FIELD DISPLAY
Email Address
First Name
Last Name
So, what is the trick to add default field "language" to the list?
Comments
Comment #2
codewhisper CreditAttribution: codewhisper commentedHy there,
I have created a patch which sets the current language automatically. Developer can just add the language as a new parameter to mailchimp_subscribe.
Comment #3
codewhisper CreditAttribution: codewhisper commentedFile mailchimp-language-parameter-2794365-1.2.patch should be applied to current stable version 1.2
Comment #4
codewhisper CreditAttribution: codewhisper commentedComment #5
LilyB CreditAttribution: LilyB at Adyax commentedAs previous patch doesn't work for version 1.3.The updated patch is: mailchimp-language-parameter-2794365-1.3.patch.
(Also was added 'Accept-Language' header dependent on the subscription language parameter. Wich allows confirmation mails to be translated.)
Comment #6
mariusdiacu CreditAttribution: mariusdiacu commentedSettings the default language only in
modules/mailchimp_signup/src/Form/MailchimpSignupPageForm.php
forces any other modules implementing mailchimp to send the language if they want this feature. For example, webform_mailchimp uses this module. It creates an email handler to subscribe to a mailchimp list instead of email sending.Also, changes in
lib/mailchimp-api-php/src/Mailchimp.php
should be maintained by https://github.com/thinkshout/mailchimp-api-phpIsn't better to set the language directly in
mailchimp_subscribe
?Comment #7
mariusdiacu CreditAttribution: mariusdiacu commentedComment #8
codewhisper CreditAttribution: codewhisper commented@mariusdiacu you are right. I changed your patch slightly to have
mailchimp_subscribe_process
with an optional language parameter.@LilyB I am not sure, that the
Accept-Language
header is needed. I can't find it in the API documentation. Can you share a link? Anyhow mariusdiacu is right. The changes should be made in the mailchimp lib directly.https://github.com/thinkshout/mailchimp-api-php
Comment #9
das-peter CreditAttribution: das-peter at Cando commentedJust come across the same issue with the 7.x-5.x branch and opted for the same approach.
Patch for 7.x-5.x attached.
Unfortunately the 7.x-5.x branch doesn't seem to be enabled for automated testing, so I disabled that for this patch.
Comment #10
samuel.mortensonComment #11
rjacobsen0 CreditAttribution: rjacobsen0 commentedNice patch! Rerolling it to apply to updated codebase. Will check it in.
Comment #13
rjacobsen0 CreditAttribution: rjacobsen0 commented