I'm setting up a subscription center. It seems like my code works fine when I open the link from the preview email. It recognizes the subscriber and updates the record without any issue. However, when I send the email for a test, it doesn't recognize the subscriber anymore and doesn't fetch their data. I'm not sure what's going on.
As an additional note, my code was working initially, and suddenly it stopped passing the value. It's very strange.
%%[ SET @sk = AttributeValue('_subscriberkey') try IF RequestParameter('submitted') == True THEN SET @sk = RequestParameter('EmailAddress') SET @rowsupdated = UpdateData('pCenterFEMSA',1,'EmailAddress', @sk,'Nombre', RequestParameter('Nombre'),'Apellido', RequestParameter('Apellido'),'FechaNacimiento', RequestParameter('FechaNacimiento'),'Newsletter', iif(RequestParameter('Newsletter') == 'on', 'True', 'False'),'Promociones', iif(RequestParameter('Promociones') == 'on', 'True', 'False'),'NuevosLanzamientos', iif(RequestParameter('NuevosLanzamientos') == 'on', 'True', 'False')) IF @rowsupdated == 1 THEN output(v("<div>Si se logro</div>")) ELSE output(v("<div>No se logro</div>")) ENDIF ENDIF SET @rows = LookupRows("pCenterFEMSA", "EmailAddress", @sk) IF rowcount(@rows) > 0 THEN SET @row = row(@rows, 1) SET @email = field(@row, "EmailAddress") SET @Nombre = field(@row, "Nombre") SET @Apellido = field(@row, "Apellido") SET @FechaNacimiento = format(field(@row, "FechaNacimiento"), "yyyy-MM-dd") SET @Newsletter = field(@row, "Newsletter") SET @Promociones = field(@row, "Promociones") SET @NuevosLanzamientos = field(@row, "NuevosLanzamientos") SET @EmailOptIn = field(@row, "EmailOptIn") IF @Newsletter == True THEN SET @Newsletter = 'checked' ENDIF IF @Promociones == True THEN SET @Promociones = 'checked' ENDIF IF @NuevosLanzamientos == True THEN SET @NuevosLanzamientos = 'checked' ENDIF ENDIF catch (@exception) output(concat("<div>Error: ", @exception.description, "</div>"))]%%<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Formulario</title></head><body><h2>Ingresa tus datos:</h2><form action="%%=RequestParameter('PAGEURL')=%%" method="post"><label for="EmailAddress">Email:</label><br /><input type="EmailAddress" id="EmailAddress" name="EmailAddress" value="%%=v(@email)=%%" required /><br /><label for="Nombre">Nombre:</label><br /><input type="text" id="Nombre" name="Nombre" value="%%=v(@Nombre)=%%" /><br /><label for="Apellido">Apellido:</label><br /><input type="text" id="Apellido" name="Apellido" value="%%=v(@Apellido)=%%" /><br /><label for="FechaNacimiento">Fecha de Nacimiento:</label><br /><input type="date" id="FechaNacimiento" name="FechaNacimiento" value="%%=v(@FechaNacimiento)=%%" /><br /><label for="Newsletter">¿Desea recibir nuestro newsletter?</label><br /><input type="checkbox" id="Newsletter" name="Newsletter" %%="v(@Newsletter)" ="%%" /><br /><label for="Promociones">¿Desea recibir nuestras promociones?</label><br /><input type="checkbox" id="Promociones" name="Promociones" %%="v(@Promociones)" ="%%" /><br /><label for="NuevosLanzamientos">¿Desea recibir información sobre nuestros nuevos lanzamientos?</label><br /><input type="checkbox" id="NuevosLanzamientos" name="NuevosLanzamientos" %%="v(@NuevosLanzamientos)" ="%%" /><br /><br /><input name="submitted" type="hidden" value="True" /><input type="submit" value="submit" /></form></body></html>
When opening it from the email previewWhen opening it from a test email send.
---Update---
I leave the email with which I send to the landing. Basically, it's just a button with the link to the cloud page. It's not a big deal, I don't understand what's happening :(