Closed mikefantini closed 9 years ago
cc @sheydari-ds. How are we going to detect user county? Fastly headers?
@sergii-tkachenko Yes, it's going to be via Fastly Country-code headers.
Ok, we can implement custom language detection strategy and just pass current language code to the templates.
@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.
@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.
I don't think so. @sheydari-ds?
@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.
@sheydari-ds do you mind creating an issue for this just to make sure all the work that's needed is documented?
@mikefantini Referenced here: https://github.com/DoSomething/phoenix/issues/4959
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).
dosomething_user_new_user()
to include user languagedosomething_user_new_user()
to include new user template name OR allowdosomething_mbp()
to define template name. https://github.com/DoSomething/phoenix/blob/dev/lib/modules/dosomething/dosomething_user/dosomething_user.module#L448-L514dosomething_mbp_get_template_name()
to define the template name based on the user language rather than the currentdosomething_settings_get_affiliate_country_code()
. Use theuser_language
value in the$param
value passed in thedosomething_mbp_request()
call.Note: Country code is currently returned by
dosomething_settings_get_affiliate_country_code()
rather than language of user.Related:
BLOCKED by: