AddEmailAddress
This call adds email addresses to existing employee records in PureSafety. Email addresses added through this method are created as "Work" type email addresses. You can indicate if the new address should become the primary email address. Email messages generated from the PureSafety are sent to employees' primary email address.
Information | |
---|---|
Syntax |
AddEmailAddress(UserLoginWebServiceEntity userLoginWebServiceEntity, string employeeCode, string emailAddress, bool isPrimary) |
Fields | |
Required Fields |
|
Optional Fields |
IsPrimary Note: False can be used to indicate that
a value is not provided.
|
Response |
Note: When an email address is added that
already exists for that employee, an error displays.
|
Sample Code - C#
public void Sample()
{
UserLoginWebServiceEntity userLoginWebServiceEntity = new UserLoginWebServiceEntity();
userLoginWebServiceEntity.WebServiceLoginName = "username";
userLoginWebServiceEntity.WebServiceLoginPassword = "password";
string employeeCode = "JB01";
string emailAddress = "jb@email.com";
bool isPrimary = true;
// Invoke the call
try
{
EmployeeWebServiceContractClient employeeWebService = new EmployeeWebServiceContractClient();
employeeWebService.AddEmailAddress(userLoginWebServiceEntity, employeeCode, emailAddress, isPrimary);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
Sample Code - Java
public void JavaSample()
{
UserLoginWebServiceEntity userLoginWebServiceEntity =
new UserLoginWebServiceEntity("username","password");
String employeeCode = "JB01";
String emailAddress = "jb@email.com";
boolean isPrimary = true;
try { //Invoke the call
EmployeeWebServiceLocator locator = new EmployeeWebServiceLocator();
EmployeeWebServiceContract employeeWebService = locator.getbasicEndpoint();
employeeWebService.addEmailAddress(
userLoginWebServiceEntity,
employeeCode,
emailAddress,
isPrimary
);
}
catch (Exception e) {
e.printStackTrace();
}
}