Conditionally Send Email
Last Post 05-04-2010 08:02 AM by Joe Craig. 2 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Joe CraigUser is Offline
going with the flow
going with the flow
Posts:58
Avatar

--
05-03-2010 02:20 PM

    I'm looking for a way to send an email conditionally.

    Specifically, I want to run a SQL query and, depending on the result, send the email.

    Is there a way to do that?

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    05-04-2010 07:09 AM
    Well, can you state the SQL query here? Is this SQL query going to be on a combobox or textbox? Depending on which field type it is, you can either create an email based on that question's response or use client side javascript to set a hidden field and based it on that hidden field's response. -- David
    Joe CraigUser is Offline
    going with the flow
    going with the flow
    Posts:58
    Avatar

    --
    05-04-2010 08:02 AM

    Sure.

    The form collects names and email addresses.  When the user clicks the submit button there are 3 completion events.

    1.  Dynamic SQL Statement: If the user's email address has not already been entered in our database table, it is added.  This is a

    if (select count(email) from myTable where email='$(Email)')=0

    INSERT INTO  {databaseOwner}[{objectQualifier}NewsletterSubscribers]([UniqueCompletionID],[ResponseDateTime],[UserID],[IPAddress],[FirstName],[LastName],[Email],[State])VALUES ('$(UniqueCompletionID)',GetDate(),$(UserID),'$(IPAddress)','$(FirstName)','$(LastName)','$(Email)','$(State)')

    2.  Email Event.  I'd like to send the email only if the first event resulted in a database insert

    3.  Redirect Event.  This one always redirects.



    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi