sp_After_Sms_Job

sp_After_Sms_Job

sp_After_Sms_Job is triggered upon completion of an SMS job.

Remarks

This procedure should not be called directly by developer, it is automatically called by Boomerang services after completion of a SMS job. This handler is invoked by Boomerang services both in event of success and failure.

Default body of this procedure is blank, thus user may provide their own code implementation for follow-up purposes.

Any changes to handler parameter list cannot be made. New parameters may add with future Boomerang releases upon which a notice will be sent separately.

Syntax

exec sp_After_Sms_Job @jKey=..., @lKey=... , @error_level=...

Parameters

Column Name Data type Direction Description Default Status
@jKey uniqueidentifier in Job key jKey found in OUT_SMS table Required
@lKey uniqueidentifier in Log entry key lKey found in EVENT_LOG table Required
@error_level int in Error status (0 = success, 1 = business, 2 = system) Required

Return Code Values

0 (success) or non-zero (failure)

Examples

Tag customer order shipment confirmation as “sent”.

ALTER procedure [dbo].[sp_After_Sms_Job] 
(
  @jKey uniqueidentifier ,
  @lKey uniqueidentifier ,
  @error_level int 
)
as begin
  set nocount on
 
--- Demo Code Automatic Output SMS message -----
declare @gKey uniqueidentifier, @jKeyOut uniqueidentifier
 
--- Send a reply SMS message -------
set @gKey = NEWID()
set @jKeyOut = NEWID()
 
insert EVENT_MASTER(gKey, Str1) values (@gKey, 'Email SMS Status Changes')
insert OUT_EMAIL(gKey, jKey, [Subject], IncludeKey) values (@gKey, @jKeyOut, 'SMS job completed for jKey: ' + cast(@jKey as varchar(50)) + ' Status: ' + cast(@error_level as varchar(3)) ,0) 
insert OUT_EMAIL_RECIPIENT (jKey, Email) values (@jKeyOut, 'michael@fuel9.com')
update EVENT_MASTER set Status = 0 where gKey = @gKey
 
end

See also

OUT_SMS
IN_SMS
sp_On_SMS_In
sp_On_Sms_Status
sp_Resubmit_Sms
Configuring SMS Services – Twilio