Posted on 30/10/2018 12:46:46
HI Martin
I would need to see the settings of the abondoned cart provider in email marketing as well.
This is the raw SQL that finds the emails - and it adds some extra filtering based on the settings on your abondoned cart provider.
Dim sql As New Text.StringBuilder()
sql.AppendLine("SELECT OrderID, OrderCustomerEmail, OrderCustomerName, OrderCustomerAccessUserID")
sql.AppendLine("FROM EcomOrders")
sql.AppendLine("WHERE")
sql.AppendLine(" OrderComplete = 0")
sql.AppendLine(" AND OrderCart = 1")
sql.AppendLine(" AND OrderModified " & GetOrderModifiedWhereClause(IgnoreAbandonedCartsOlderThan, MarkAbandonedAfter))
sql.AppendLine(" AND OrderCustomerEmail IS NOT NULL")
sql.AppendLine(" AND OrderCustomerEmail <> ''")
If RequireEitherCustomerLoggedInOrAcceptedTerms OrElse RequireCustomerLoggedIn OrElse RequireCustomerAcceptedSalesTerms Then
sql.AppendLine(" AND (")
If RequireEitherCustomerLoggedInOrAcceptedTerms OrElse RequireCustomerLoggedIn Then
sql.AppendLine(" OrderCustomerAccessUserID > 0")
End If
If RequireEitherCustomerLoggedInOrAcceptedTerms Then
sql.AppendLine(" OR")
ElseIf RequireCustomerLoggedIn AndAlso RequireCustomerAcceptedSalesTerms Then
sql.AppendLine(" AND")
End If
If RequireEitherCustomerLoggedInOrAcceptedTerms OrElse RequireCustomerAcceptedSalesTerms Then
sql.AppendLine(" OrderCustomerAccepted = 1")
End If
sql.AppendLine(" )")
End If
If Not String.IsNullOrWhiteSpace(AbandonedCartsShop) Then
sql.AppendLine(" AND OrderShopID = '" & AbandonedCartsShop & "'")
End If
If Not String.IsNullOrWhiteSpace(AbandonedCartsLanguage) Then
sql.AppendLine(" AND OrderLanguageID = '" & AbandonedCartsLanguage & "'")
End If
Looking at this, and seeing the code, I think it is because that when you start the checkout step, OrderCart in the database is no longer true - but false since the user is basically in a checkout step and has been converted to an order which is still not marked as complete.
So there are 2 options - somehow post back the order form when the email is entered without going to the checkout step - that will save the email on the order. The other option is to modify the standard provider you got here, and create you own version (it is just an addon) and remove that check from the SQL (and make other needed changes). I've attached the latest version of the provider used on DW8.
That said, I am not sure (actually pretty sure) that accepted terms is enough for sending out abandoned cart emails if you read the GDPR regulations. So still consider if this is for a brand that can take the heat if it comes up. From the regulation:
“... freely given, specific, informed and unambiguous indication ... by a statement or by a clear affirmative action ...”
I would say that you need something like this to be compliant.
[ ] Accept terms and condition
[ ] Accept emails from us with XX and YY
Eventhough I am not a legal advisor, this is what seems to be consensus from those wanting to stick to legislation without bending the rules.
BR Nicolai