com.shephertz.app42.paas.sdk.jme.email
Class EmailService

java.lang.Object
  extended by com.shephertz.app42.paas.sdk.jme.email.EmailService

public class EmailService
extends java.lang.Object

Service to send Email

See Also:
Email

Constructor Summary
EmailService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
          this is a constructor that takes
 
Method Summary
 Email createMailConfiguration(java.lang.String emailHost, int emailPort, java.lang.String mailId, java.lang.String emailPassword, boolean isSSL)
          Creates Email Configuration using which in future the App developer can send mail
 Email getEmailConfigurations()
          Gets all Email Configurations for the app
 App42Response removeEmailConfiguration(java.lang.String emailId)
          Removes email configuration for the given email id.
 Email sendMail(java.lang.String sendTo, java.lang.String sendSubject, java.lang.String sendMsg, java.lang.String fromEmail, java.lang.String emailMime)
          This Service is used to send Emails.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailService

public EmailService(java.lang.String apiKey,
                    java.lang.String secretKey,
                    java.lang.String baseURL)
this is a constructor that takes

Parameters:
apiKey -
secretKey -
baseURL -
Method Detail

createMailConfiguration

public Email createMailConfiguration(java.lang.String emailHost,
                                     int emailPort,
                                     java.lang.String mailId,
                                     java.lang.String emailPassword,
                                     boolean isSSL)
                              throws App42Exception
Creates Email Configuration using which in future the App developer can send mail

Parameters:
emailHost - - Email Host to be used for sending mail
emailPort - - Email Port to be used for sending mail
mailId - - Email id to be used for sending mail
emailPassword - - Email Password to be used for sending mail
isSSL - - Should be send using SSL or not
Returns:
Email object containing the email configuration which has been created
Throws:
App42Exception

getEmailConfigurations

public Email getEmailConfigurations()
                             throws App42Exception
Gets all Email Configurations for the app

Returns:
Email object containing all Email Configurations
Throws:
App42Exception

removeEmailConfiguration

public App42Response removeEmailConfiguration(java.lang.String emailId)
                                       throws App42Exception
Removes email configuration for the given email id. Note: In future the developer wont be able to send mails through this id

Parameters:
emailId - - The email id for which the configuration has to be removed
Returns:
App42Response object containing the email id which has been removed
Throws:
App42Exception

sendMail

public Email sendMail(java.lang.String sendTo,
                      java.lang.String sendSubject,
                      java.lang.String sendMsg,
                      java.lang.String fromEmail,
                      java.lang.String emailMime)
               throws App42Exception
This Service is used to send Emails. This service can be used by app to send mail to one or multiple recipients.

Parameters:
sendTo - - The email ids to which the email has to be sent. Email can be sent to multiple email ids. Multiple email ids can be passed using comma as the separator e.g. sid@shephertz.com, info@shephertz.com
sendSubject - - Subject of the Email which to be sent
sendMsg - - Email body which has to be sent
fromEmail - - The Email Id using which the mail(s) has to be sent
emailMime - - MIME Type to be used for sending mail. EmailMIME available options are PLAIN_TEXT_MIME_TYPE or HTML_TEXT_MIME_TYPE
Returns:
Email object containing all the details used for sending mail
Throws:
App42Exception