I am pulling in First Name from subscriber information but it has been encrypted before the data is pushed up to ExactTarget, I need to use AMPscript to decrypt and check the data to make sure it is valid and there. The code validates fine on its own the problem seems to come from how much code we place there, the email will not send with the AMPscript there.
I was given the following recommendations by support as to why the email did not send and also how to resolve:
Thank you for contacting us with your question. I have been re-assigned your case and have been researching this further for you.
The issue does appear to be within the AMPScript. I sent myself the email as a guided send and it would not send to me. There were no errors but the job would never complete. I updated my profile attributes so that I would have a first name, and I received an error that there were to many characters in the subject line.
The issue is within the AMPScript, and unfortunately being able to fix or write this for you to where it works is beyond what Standard Support is able to provide as this is considered custom code.
There are a couple recommendations I can make at this point:
Update the First Name attribute. You can update the attribute to have a default value such as "Valued Customer", so that if they do not have a First Name filled out, then it will put the default value instead.
Inquire at code.exacttarget.com. This is a web-portal that is maintained by our developers and has a very active community. If you post what you are trying to do, then you may be able to get assistance with your custom AMPScript code from one of our developers or another developer from a different organization that has experience with this type of issue.
One of the solutions was to post here, I am hoping somebody ha some insight as to another way to decrypt and pull in and decrypt the First Name. I have included the code I am using below, any help would be appreciated.
Thanks!
%%[
var @f_name, @firstname
IF Empty(first_name) == true then
InsertDE("ent.ErrorLog","EmailAddress",emailaddr, "EmailName",emailname_, "ErrorMessage","First Name is Empty", "CreatedDate",NOW(), "EmailSendID",jobid)
RaiseError("first name is blank. Decrypt is going to blow! Skipping.", true)
ENDIF
set @f_name=DecryptSymmetric(first_name, "des;mode=cbc", @null, "A4DF6AF2", @null, @null, @null, @null)
IF Empty(@f_name) == true then
InsertDE("ent.ErrorLog","EmailAddress",emailaddr, "EmailName",emailname_, "ErrorMessage","First Name Data did not decrypt", "CreatedDate",NOW(), "EmailSendID",jobid)
RaiseError("first name data did not decrypt", true)
ENDIF
set @firstname = ProperCase(@f_name)
]%%
%%=v(@firstname)=%%, welcome to a healthier you!