Click or drag to resize
ZenophSMSschedule Method (NullableDateTime, String, String)
Sets a flag to indicate that the message should be submitted later at a specified date and time. The time portion must be in 24hr format.

Namespace: Zenoph.SMSLib
Assembly: Zenoph.SMSLib (in Zenoph.SMSLib.dll) Version: 2015.9.30.0 (2015.09.30.0)
Syntax
public void schedule(
	Nullable<DateTime> datetime,
	string tzregion,
	string tzcity
)

Parameters

datetime
Type: SystemNullableDateTime
The local date and time at which the message will be submitted to the recipients.
tzregion
Type: SystemString
The region for the time zone.
tzcity
Type: SystemString
The time zone city from which a time zone offset should be determined.
Exceptions
ExceptionCondition
Exception Thrown if datetime is null or when tzregion and tzregion pair do not identify a valid PHP time zone.
Remarks

The method determines the GMT offset to be used as the time zone based on tzregion (the time zone region) and tzcity (a relative time zone city). tzregion should be one of the regions such as Africa, Europe, Asia, etc., whiles tzcity should be one of the cities which uses the same time as meant for the specified date and time.

tzregion and tzcity are not arbitrary but should be one of the time zone region and city pairs available at the API section of the website. These are actually provided by PHP. The cities are not necessarily where a user or recipient is located but rather a reference to a city that uses the same time as meant for the specified date and time.

With this method, there is no need to worry about daylight saving time changes. Once the correct region and reference city are set, the GMT offset is automatically determined and is used for datetime.

Examples
The following code sets the date and time for scheduling as well as reference to a city from which the time zone offset should be determined.
// Initialise the SMS object and perform authentication
ZenophSMS sms = new ZenophSMS();
sms.setUser("account_login");
sms.setPassword("account_password");
sms.authenticate();

sms.setMessage("Hello there!");
sms.addRecipient("233246111111");

/*
 * Set the region and city for determining the time zone offset.
 * The region and city are provided by PHP and can be used here.
 */
DateTime datetime = new DateTime(2015, 6, 3, 13, 45, 0);
sms.schedule(datetime, "Africa", "Accra");

// an alternative
sms.schedule(datetime, "America/Indiana", "Petersburg");

As earlier indicated, tzregion and tzcity are pairs that are provided by PHP. These can be viewed at the API section of the website.

See Also