Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@0xvoila
Created May 9, 2017 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xvoila/1a125c58be35eb37120cd7fa4976decf to your computer and use it in GitHub Desktop.
Save 0xvoila/1a125c58be35eb37120cd7fa4976decf to your computer and use it in GitHub Desktop.
Public Class Account {
String accountService = null;
EmailService emailService = null;
public setAccountEmailProviderName(accountEmailProvider){
this.accountService = accountEmailProvider;
}
public void setupAccount(){
if (accountService == "google"){
emailService = Class.forName('GmailEmailProvider').getInstance();
}
else if(accountService == "yahoo"){
emailService = Class.forName('YahooEmailProvider').getInstance();
}
else {
emailService = Class.forName('HotmailEmailProvider').getInstance();
}
MailInit init = new MailInit(userName, password, emailService);
}
}
public Class MailInit{
public void initialConfiguration(String userName, String password, EmailService emailService ){
MailConfiguration.userName = userName;
MailConfiguration.password = password;
MailConfiguration.emailService = emailService;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment