RFC: Repeating regions in email

Hi all,

Repeating regions for email is quite a requested feature.

I’ve been working on a custom extension for this(nodejs).

The idea behind the extension is that you will create a template file that holds the design and static text for the email and the extensión will compile it and inject SC data bindings allowing for repeating regions defined in the template.

This way you separate design from data.

So instead of this:

You just need this:

To get something like this:

It’s still a work in progress but I’m open to suggestions and feedback. Please let me know if you need anything in particular.

13 Likes

Hey Jon where did you acquire your Java skills if you do not mind me asking?

Java? 1st and 2nd year of uni it I remember correctly.
But I am guessing you are referring to javascript. Here and there. Reading code mainly.

Yes, my bad. Javascript. Something I should have learned more about in hindsight and am now catching up slowly. Guess I’ll continue reading and watching videos. Hopefully will get up to speed over the next twelve months.

1 Like

Wappler JS code is also a pretty good source of knowledge. As you already understand the outcome it’s easy to connect the dots.

1 Like

When’s the classic ASP version coming? My IIS 6.0 is waiting.

3 Likes

Exactly!

When is Classic ASP extensibility coming?

2 Likes

I’m close to finishing it.

i’ve been testing extensively and squashing some bugs.

Here a new example more in line with what you would expect.

So given this data:

{
  "invoice" : "#650RGE-0051",
  "user": {
    "name": "Matthew",
    "gender": "male",
    "address": "Matthew S. Bronson, 102 Duck Creek Road, Palo Alto, CA 94306"
  },
  "order": {
    "items": [
      {
        "title": "Collective Multi Watch",
        "image_URL": "https://res.cloudinary.com/kissassets/image/upload/v1556260256/ynyzkfvtdbjkhr8gf98k.jpg",
        "price": {
          "currency": "$",
          "amount": 115.99
        },
        "quantity": 1
      },
      {
        "title": "Moccamaster Coffee Brewer",
        "image_URL": "https://res.cloudinary.com/kissassets/image/upload/v1556260256/xpyck59d9q5396n6yvbw.jpg",
        "price": {
          "currency": "$",
          "amount": 310.99
        },
        "quantity": 1
      },
      {
        "title": "Digital Instant Print Camera",
        "image_URL": "https://res.cloudinary.com/kissassets/image/upload/v1556260256/rdgfgpemfzjzqai4en8o.jpg",
        "price": {
          "currency": "$",
          "amount": 59.99
        },
        "quantity": 1
      }
    ],
    "shipping": {
      "carrier": "Fedex",
      "currency": "$",
      "amount": 10
    },
    "total": {
      "currency": "$",
      "amount": 486.97
    },
     "payment": {
     	"method": "Visa", 
       	"4digits": "4354",
        "amount": 496.97
     }
  }
}

When you use it as data source for your Email template step:

And you have an MJML template:

You can use repeating blocks like the following inside your mjml template:

{{#each data.order.items}}
<tr>
    <td style="padding:15px 0;">
        <img style="vertical-align:middle" width="40px" src={{this.image_URL}} /> {{this.title}}
    </td>
    <td style="padding:15px 0;">{{this.quantity}}</td>
    <td style="padding:15px 0;">{{this.price.currency}}{{this.price.amount}}</td>
</tr>
{{/each}}

So when you send an email with the content generated by the Email template step

You get something like this:

Which will always look great in any device, viewport, OS, and email software.

On my mobile phone:

10 Likes

This looks amazing!

2 Likes

Thanks for sharing once again @JonL!! Will probably have a great use for this soon.

You fill in a lot of the current gaps of Wappler. Thank you so much!

1 Like

Was this finished/released? Could really use this for my project!

Give me a few days and I’ll package it into something usable.

4 Likes

Is your future package usable by beginners like me?
Maybe you’ve shared some instructions already?

I hope so. Unfortunately I haven’t progressed as holidays got in the middle. I will resume work on it in September.

1 Like

I’m surprised Wappler team hasn’t introduced this yet. It’s much needed.

4 Likes

@JonL, do you have this extension available? :smiley:

4 Likes

I’m interested in this too, it really looks great.

Sorry guys. Not ready yet :frowning:

2 Likes

Hey @JonL, just wanted to check to see if this was ready. :slight_smile:

I saw some time ago that this is in the roadmap for Wappler features. So I didn’t invest more time on it. I mean I have something working for my needs(which are very specific) but didn’t think it was worth investing more if it is going to be built eventually.

1 Like