• Resolved Tim de Hoog

    (@tim_nl)


    I have 2 custom fields but when i add them to the newsletter they are not changed to the value saved in the database. They are removed.

    The default fields of Mailpoet don’t have this problem and works fine.

    I use the latest free version of Mailpoet 3.

    What is going wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Tim,

    How are you adding the fields to the MailPoet Newsletter, with a custom shortcode or a different way?

    Thanks!

    Thread Starter Tim de Hoog

    (@tim_nl)

    With the shortcode generated by the button in in the header of the editor.

    As described on this page: https://beta.docs.mailpoet.com/article/215-personalize-newsletter-with-shortcodes

    Hi Tim,

    Can you post the shortcode you are using, please? Is it the first name and last name fields that aren’t outputting?

    As if it’s a custom field, there aren’t any shortcodes for those out the box, unless you create a custom shortcode. In which case can you post a link to the code you used to create said shortcode.

    Thanks!

    Thread Starter Tim de Hoog

    (@tim_nl)

    Thank you for your time.

    No the first- and lastname are working fine.

    I have created the custom fields during uploading of new users to a list. The names of the fields are “onderdeel” and “tijd” (it’s for a Dutch website).

    I can see the data by each member so it is saved into the database. When i create a newsletter i can add first- and lastname but also my own custom fields. The custom fields are called [subscriber:cf_2] and [subscriber:cf_3].

    I don’t have added any custom PHP code. Should i?

    Hi Tim,

    Sorry, unfortunately, that’s not possible to display custom fields just replacing the field name on the shortcode.

    You can only use the shortcodes listed here or create a custom shortcode to outputs custom content or custom links.

    Thread Starter Tim de Hoog

    (@tim_nl)

    Alright thank you for your answer.

    I have written the code that will replace the custom code.

    To retrieve the custom field value of each subscriber i have used the code below.
    $subscriberData = \MailPoet\API\API::MP(‘v1’)->getSubscriber($subscriber->id);

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom fields in newsletter don’t work’ is closed to new replies.