Viewing 7 reply threads
  • Author
    Posts
    • #6836
      eflouret
      Member

      Sorry, I didn’t know how to write a proper title for my question. I’m not into this task yet, I’m still learning the workflow setup.

      What I want to do is a newsletter creation system in my wordpress admin.
      I created a custom post type “newsletter” and workflow for that custom type.
      In the first tab I add all the custom input fields, with repeaters, for the content of the newsletter.

      In the second tab I would like to generate the proper html using a special responsive email html template I created. Then copy and paste that code in my Aweber account.

      So, the second tab should be able to process all the information from the published post and generate a special html that I can then copy and paste.

      I don’t know if I’m clear enough. It is a process similar to those sites, like youtube, that generate an embed code (tab 2) using user input variables (tab 1).

      Is that possible with Piklist? I know everything is possible. But before I start messing around with code, I would like to know if there is some way to do that with Piklist or at least some hints on how to achieve this.

      Thanks!

      Enrique

    • #6837
      eflouret
      Member

      I forgot to mention that the newsletter is published as a post with my current web site theme.

      And how about this to generate the embed code?:
      In the functions.php file I add a publish_post action where I generate the newsletter embed code looping through all the post meta information for that newsletter post.
      Then I save the embed code in another custom field that is then shown in the TAB2, where I can copy and paste it, and save it for future use.

      Do you think that’s the simplest way to go, or is there something in Piklist that can do this job easier.

      Thanks!

      Enrique

    • #6844
      Steve
      Keymaster

      @eflouret– I really like this idea!

      Building this is the second workflow tab, will actually be very similar to doing this in a theme. Can you post a small snipped of what you think the embed code should look like?

    • #6847
      eflouret
      Member

      Hi Steve, thanks for your reply.

      Sorry, let’s close this ticket until I have a more specific question to ask.

      Thanks,

      Enrique

    • #6848
      Steve
      Keymaster

      I wrote some sample code before I saw your latest response. I think it will help.

      The idea is this:
      1) Once you save the data from the first tab, it is available for the second tab.
      2) Use standard WordPress functions like get_post_meta() to display the data in the second tab.
      3) Use Object buffering to make it easy for you to layout your template with the get_post_meta references.
      4) Display the data in a textarea field, for easy copying and pasting.

      Here’s my sample code. Please let me know if it helps: https://gist.github.com/sbruner/4065b29164835f207b3cec6ddf0ea9f9

    • #6849
      eflouret
      Member

      Steve, you are awesome. That seems to be what I was looking for.

      I can’t think of better support than the one I get with Piklist!

      I’ve just rated Piklist with 5 stars.

      Where do I paste this code? I assume it goes in the functions.php file, but I’m not sure.

      Thanks!

      Enrique

    • #6850
      Steve
      Keymaster

      @eflouret– Thank you so much for the great review!

      This code goes right into your Piklist meta-boxes file that is being rendered in the second WorkFlow tab… no functions.php is necessary!

    • #6851
      eflouret
      Member

      Awesome! thanks!

Viewing 7 reply threads
  • The topic ‘Generating an embed code with post meta info inside a workflow tab’ is closed to new replies.