-
3
Answers
-
Last Activity:
long time ago,
Kyle
Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
The trigger you see below is working, but how could I modify this so that it would also pull data from the fields IRSBackup and userid from another table called ABC_DB_OnlineForms? The common field between the two tables is FormID. And ideally, the body of the email message in the end would read like this
userid: (some value)
Confirmation Code: (some value)
Subject to IRS Backup Withholding? (0=No, 1= Yes): 0 or 1
CREATE TRIGGER SendEmail
ON [ABC].[dbo].[ABC_DB_OnlineFormsConfirm]
AFTER INSERT
AS
Begin
Declare @MessageBody varchar(100)
select @MessageBody=ConfirmationCode from Inserted
exec msdb.dbo.sp_send_dbmail @profile_name = 'Gmail',
@recipients = 'ABC@ABC-inc.com',
@subject='An ABC Online App Has Been Completed',
@body=@MessageBody
End