Class tcEmailNotificationUtil

java.lang.Object
com.thortech.xl.dataobj.util.tcEmailNotificationUtil

public class tcEmailNotificationUtil extends Object
This class is used to construct the emails to be send. From 11gR1 onwards it's recomended to use NotificationService to construct and send emails.

The flow is as follows:

  • Get instane: using constructor tcEmailNotificationUtil
  • Construct Email: using method constructXYZEmail
  • Set Email content(Optional): using methods setSubject/setBody
  • Send constructed Email: using method sendEmail
  • Version:
    Author:
    Paris York
    • Constructor Details

      • tcEmailNotificationUtil

        public tcEmailNotificationUtil()
        Creates new tcEmailNotificationUtil
      • tcEmailNotificationUtil

        public tcEmailNotificationUtil(com.thortech.xl.dataaccess.tcDataProvider poDataProvider)
        Creates a new tcEmailNotificationUtil object.
        Parameters:
        poDataProvider - DataBase Conenction
    • Method Details

      • setEmailType

        public void setEmailType(String psEmailType)
        Sets the Email Type
        Parameters:
        psEmailType - EmailType, value can be "P"(Provisioning), "R"(Request) or "G"(General)
      • getEmailType

        public String getEmailType()
        Returns the Email Type
        Returns:
        String EmailType
      • getFromAddress

        public String getFromAddress()
        Returns the From Address
        Returns:
        String FromAddress
      • setFromAddress

        public void setFromAddress(String address)
        Sets the From Address
        Parameters:
        address - FromAddress
      • setSubject

        public void setSubject(String value)
        Sets the Subject of the Email
        Parameters:
        subject - Subject
      • setBody

        public void setBody(String value)
        Sets the Body of the Email
        Parameters:
        EmailBody - EmailBody
      • constructEmail

        public void constructEmail(String psEmdName)
        Gets the email definition and puts it in the internal variables
        Parameters:
        psEmdName - Name of the Email Definition
      • constructEmail

        public void constructEmail(String psEmdKey, String psReqKey)
        Deprecated.
        Not recomended to use from 11gR1 onwards.
        Gets the email definition and Request key. Puts it on the internal variables.
        Parameters:
        psEmdKey - Email Definition Key
        psReqKey - Request Key
      • constructEmail

        public void constructEmail(String psEmdKey, String psReqKey, String userKey)
        Gets the email definition and Request key. Puts it on the internal variables.
        Parameters:
        psEmdKey - Email Definition Key
        psReqKey - Request Key
        userKey - User Key
      • constructEmail

        public void constructEmail(String psEmdKey, String psReqKey, String psSchKey, String psObiKey, String usrkey)
        Constructs the Email.
        Parameters:
        psEmdKey - Email Definition Key
        psReqKey - Request Key
        psSchKey - SCH Key
        psObiKey - OBI Key
        usrKey - User Key
      • constructEmail

        public void constructEmail(String psEmdKey, String psReqKey, String psSchKey, String psObiKey)
        Deprecated.
        Not recomended to use from 11gR1 onwards.
        Constructs the Email.
        Parameters:
        psEmdKey - Email Definition Key
        psReqKey - Request Key
        psSchKey - SCH Key
        psObiKey - OBI Key
      • constructProvisionEmail

        public void constructProvisionEmail(String psEmdKey, String psSchKey)
        Constructs the Provisioning Email.
        Parameters:
        psEmdKey - Email Definition Key
        psSchKey - SCH Key, Refer to tcProvisioningOperationsIntf for SCH Key
      • getFromRequest

        public String getFromRequest(String psEmdKey, String psReqKey)
        Deprecated.
        Not recomended to use from 11gR1 onwards.
        Returns the From Address for the email definition and Request key passed
        Parameters:
        psEmdKey - Email Definition Key
        psReqKey - Request Key
        Returns:
        String From Address
      • getFromProvision

        public String getFromProvision(String psEmdKey, String psSchKey)
        Returns the From Address for the email definition and task instance key passed
        Parameters:
        psEmdKey - Email Definition Key
        psSchKey - SCH Key, Refer to tcProvisioningOperationsIntf for SCH Key
        Returns:
        String From Address
      • constructPasswordEmail

        public void constructPasswordEmail(String psEmdName, String usrKey)
        Gets the email definition and puts it in the internal variables
        Parameters:
        psEmdName - Name of the Email Definition
      • sendEmail

        public void sendEmail(String psToAddress)
        Sends to Email to the Address paased as a parameter
        Parameters:
        psToAddress - TO Address
      • sendEmailNotification

        public static void sendEmailNotification(com.thortech.xl.dataaccess.tcDataProvider db, String toAddress, String defaultFromAddress, String emdName, String reqKeyAsString)
        Sends Email Notification
        Parameters:
        db - DataBaseConnection Object
        toAddress - Address to whom the mail is to be sent
        defaultFromAddress - From Address to be used in sending the mail
        emdName - Name of the Email Definition which is to be used
        reqKeyAsString - Request Key
      • sendEmail

        public void sendEmail(Vector pvToAddress)
        This is used to send the email created to several email boxes.
        Parameters:
        pvToAddress - [] - This is a list of the email addresses the email is to be sent to.
      • getBody

        public String getBody()
        This method returns the body of the email.
        Returns:
        Body of the email as a String
      • getSubject

        public String getSubject()
        This method returns the subject of the email.
        Returns:
        Subject of the email as a String
      • sendEmail

        public void sendEmail(String psToAddress, String psCCAddress)
        Sends the Email This method takes two parameter Toaddress and CC adrress. Note: CC address can be made to take multiple values.(May be added in future need)
        Parameters:
        psToAddress - To Address
        psCCAddress - CC Address