You need to sign in to do that
Don't have an account?
DJ 367
select Email template based on user's region
Hello All,
I have a custom javascript Button on OPPORTUNITY called SendEmail. I want to select my email template based on user's region. For example if user is from Germany ,german email template to be selected and if user region is USA ,english template to be selected. I am not sure how to achieve this and
which field to take into consideration from user object. Can someone please help me to achieve this.
Thanks
I have a custom javascript Button on OPPORTUNITY called SendEmail. I want to select my email template based on user's region. For example if user is from Germany ,german email template to be selected and if user region is USA ,english template to be selected. I am not sure how to achieve this and
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} if('{!Opportunity.Id}' != null){ if('{!Opportunity.SendEmail__c}' = true){ //I need to select an email template based on user's region } }
which field to take into consideration from user object. Can someone please help me to achieve this.
Thanks
You can use this :
var currentUser = sforce.connection.getUserInfo();
var result = sforce.connection.query('select LanguageLocaleKey from User where id=\''+currentUser.getUserId+'\'');
//once you have the value in result,then you can check as follows:
if(result == 'fr'){
//Your logic
}
Thanks
Somya