I currently have a vb.net app that allows to send an email using (TriggeredSendDefinition)

The problem I have, is that I need a specific date from a DataExtensionObject. I created a filter and I don´t know how to add it to the TriggeredSendDefinition.

I copy the code I have (I know the code is not good, but I am new on this).

Thank you in advance

Public Sub testTriggeredSendEmail()

        Dim Results As exacttarget.APIObject() = Nothing
        Dim request As New exacttarget.RetrieveRequest()
        Dim sfp As exacttarget.SimpleFilterPart = Nothing

        Dim definition As Object

        definition = New exacttarget.TriggeredSendDefinition()
        definition.CustomerKey = "Trigger_email3"

        'subscriber to whom email will be sent
        Dim subscriber As New exacttarget.Subscriber()
        subscriber.EmailAddress = "xxxx@xxx.es"
        subscriber.SubscriberKey = "xxxx@xxx.es"

        Dim send As New exacttarget.TriggeredSend()

        sfp = New exacttarget.SimpleFilterPart()
        sfp.[Property] = "Id_lead"
        sfp.SimpleOperator = exacttarget.SimpleOperators.greaterThanOrEqual
        sfp.Value = New String() {"145006976"}

        'Datos de Data Extension
        request.ObjectType = "DataExtensionObject[Elinper_Gcotizacion]"
        request.Properties = New String() {"Id_lead", "Grupo_de_cotizacion"}
        request.Filter = sfp
        Dim deo As exacttarget.DataExtensionObject = TryCast(Results(0), exacttarget.DataExtensionObject)
        Dim codigo As String
        codigo = deo.Properties(0).Value

        send.TriggeredSendDefinition = definition

        Dim sends As exacttarget.APIObject() = {send}

        Dim co As New exacttarget.CreateOptions()
        co.SaveOptions = New exacttarget.SaveOption(0) {}
        co.SaveOptions(0) = New exacttarget.SaveOption()
        co.SaveOptions(0).SaveAction = exacttarget.SaveAction.UpdateAdd
        co.SaveOptions(0).PropertyName = "*"

        Dim cRequestID As String = String.Empty
        Dim cStatus As String = String.Empty

        Dim servicio2 As New exacttarget.SoapClient()
        servicio2.ClientCredentials.UserName.UserName = "xxxxx"
        servicio2.ClientCredentials.UserName.Password = "Axxxttt5!"

        Dim cResults As exacttarget.CreateResult() = servicio2.Create(co, sends, cRequestID, cStatus)

    End Sub
  • Are you looking to pull the date from a data extension into your email or is the date something you're passing via the API? You cannot use filters with triggered sends as we assume you are triggering emails to subscribers that meet your criteria already. You may be able to use AMPScript to raise errors when a subscriber doesn't match a certain date but that would be hard-coded in your email. help.exacttarget.com/en/documentation/exacttarget/content/… – Jeremy Oct 15 '14 at 16:33
  • The email template shows data from the subscriber (like name, address..) and it should show data from the data extension (like the number of the insurance etc...). these last data are in a data extension and I need to use a filter to show only the current insurance. how can I connect these data to show them into the email?. There is another way to send the email?. Thanks – Mª Carmen Zapatero Oct 16 '14 at 7:17

So Jeremy answered your question about pulling in the data from the data extension: You'll use AMPScript in the email itself to do a quick data retrieval from the Data Extension based on one of the Subscriber Attributes (email address, I would presume).

If you want to filter the list of people who receive this email based on this date you'll need to use Automation Studio and a Query to build a Data Extension list of people to send to. Or maybe a Data Extension suppression list of people who not to send to and you'll reference one or both of those lists in the TriggeredSend Definition itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.