Created
May 9, 2017 14:35
-
-
Save 0xvoila/1a125c58be35eb37120cd7fa4976decf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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