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 = "[email protected]"
subscriber.SubscriberKey = "[email protected]"
Dim send As New exacttarget.TriggeredSend()
'Filtro
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
'TriggeredSendDefinition
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