DoSomething / legacy-website

:moyai: The DoSomething.org legacy website.
https://www.dosomething.org/
MIT License
50 stars 22 forks source link

Global User Registration Emails #4955

Closed mikefantini closed 8 years ago

mikefantini commented 9 years ago

When a Brazilian/Mexican user creates an account, s/he should receive a welcome to DS email in Brazilian Portuguese/Mexican Spanish.

Note: I don't think we have to add anything for the "Global English" users, because our default US English transactional email should trigger and should be good to use. Only potential pitfall is if linking people to /campaigns (which the email currently does) is a problem for global users - i.e. will this redirect global users to the global version of /campaigns.

@sergii-tkachenko I believe @DeeZone had a question on how he/message broker would know which mandrill template to send to which user (i.e. how to know whether to use the Brazilian Portuguese template or the US English one for example).


      $params = array(
        'email' => $account->mail,
        'uid' => $account->uid,
        'user_language' => dosomething_user_get_field('field_language', $account),
        'email_template' => $template,
        'first_name' => dosomething_user_get_field('field_first_name', $account),
        'reset_link' => user_pass_reset_url($account),
      );

Note: Country code is currently returned by dosomething_settings_get_affiliate_country_code() rather than language of user.


Related:

BLOCKED by:

sergiitk commented 9 years ago

cc @sheydari-ds. How are we going to detect user county? Fastly headers?

ghost commented 9 years ago

@sergii-tkachenko Yes, it's going to be via Fastly Country-code headers.

sergiitk commented 9 years ago

Ok, we can implement custom language detection strategy and just pass current language code to the templates.

deezone commented 9 years ago

@sergii-tkachenko Can I assume that the Fastly header / user country will be set in the Drupal user profile?

The goal is user registration and password reset transactionals use the country templates (thus language) based on the initial Fastly detected user origin.

deezone commented 9 years ago

@sergii-tkachenko @mikefantini Is there an issue to build the "custom language detection strategy" functionality into the Drupal code base? This functionality could then be referenced when generating the transactional message request for Message Broker.

sergiitk commented 9 years ago

I don't think so. @sheydari-ds?

ghost commented 9 years ago

@sergii-tkachenko @DeeZone I don't think so. We're doing detection on that header for a number of other things in Drupal anyways, so I don't see this as being a huge lift.

mikefantini commented 9 years ago

@sheydari-ds do you mind creating an issue for this just to make sure all the work that's needed is documented?

ghost commented 9 years ago

@mikefantini Referenced here: https://github.com/DoSomething/phoenix/issues/4959