July 1, 2010 at 12:16 pm
Per MS SQL Server 2008 training kit, I can use Database Mail to implement notifications to customers when they successfully book travel with a travel agency.
Is this done using DML triggers? I am not an application programmer so I have only a high level understanding of how one might code a script that takes the customer's email address and insert it into the database.
On the backend however, I should understand how Database Mail is configured to automatically generate a profile whenever a new booking is successfully completed for a customer.
Please tell me how this is done as at this point I understand it only as theoretically possible.
thank you.
July 1, 2010 at 12:24 pm
This doesn't answer your question, but I would highly suggest that you do NOT use database mail for such a task. The application should handle such things.
But, if you want to, here is an article about configuring it:
July 1, 2010 at 12:28 pm
it's not DB Mail configuration I'm wondering about. It's the layer in between the table (that has the customer's email) and DB mail (used for sending notifications for events) that I want to know about. Are DML triggers used to spawn a profile in DB Mail?
July 2, 2010 at 9:42 am
In a similar scenario in our system we have scheduled a call to a Stored Procedure which send mail to client using dbmail.
Cheers
July 2, 2010 at 11:20 am
Cool!
Can you share the syntax of it, minus any proprietary or private information?
July 5, 2010 at 6:32 am
Hi,
SQL Server Database Mail can be used for such a task using DML triggers. But will not suggest this way too.
Actually the dbmail just queues the mail requests and then exits.
So it will not cause the trigger to wait for a time that will lock your applications.
For DBMail solution you can check How to configure Database Mail in SQL Server 2008 R2 and Use sp_send_dbmail
But SQL Server Reporting Services has better solutions for these task.
I will suggest you create scheduled dynamic reports in SSRS for mailing from SQL Server.
July 5, 2010 at 9:21 pm
Thank you Eralper. The link answers my question.
In summary, sp_send_dbmail is a stored procedure which can be called out from within the application to trigger database mail to send the customer a confirmation email containing details of their booking as it stands in the database.
Additionally, it appears a DML trigger could be used to trigger the same stored procedure, though it would be an unconventional use of it.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply