Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Trevor Loader 199 posts 256 karma points
    May 07, 2015 @ 23:51
    Trevor Loader
    0

    Notification Message Editor - changes markup

    I am trying to make nicely formatted (html), cross email client compatiable Order Confirmation and Shipping Confirmation emails.

    The problem is that the notification message page uses a RTE for input and that throws away markup and also moves {{IterationStart[Invoice.Items]}} and {{IterationEnd[Invoice.Items]}} tags upon save (as the RTE doesn't think they are valid inside <table> markup).

    Eg, if your markup is

    <table><tbody>
    {{IterationStart[Invoice.Items]}}
    <tr>
        <td>{{Item.Name}}</td>
        <td>{{Item.Quantity}}</td>
        <td>{{Item.UnitPrice}}</td>
        <td>{{Item.TotalPrice}}</td>
    </tr>
    {{IterationEnd[Invoice.Items]}}
    </tbody></table>
    </tbody></table>

    The RTE after save does this

    {{IterationStart[Invoice.Items]}} {{IterationEnd[Invoice.Items]}}
    <table><tbody>
    <tr>
        <td>{{Item.Name}}</td>
        <td>{{Item.Quantity}}</td>
        <td>{{Item.UnitPrice}}</td>
        <td>{{Item.TotalPrice}}</td>
    </tr>
    </tbody></table>
    </tbody></table>

     

    For now I have updated the database directly in order to produce the desired emails, but run the risk that if anyone was to go to the message editor to change an email address or subject line text and save, it will save the now manipulated and incorrect email template.

    Is there a quick hack that will allow me to change this field to a normal multi-row textarea field so that the markup will not become corrupted by the RTE on save?

    For example, I tried to change....

    <!-- Template pane -->
    <input type="hidden" data-ng-bind=""/>
    <div class="control-group umb-control-group">
        <label class="merchello-control-label">
            <localize key="merchelloNotificationsEdit_emailTemplate" />
            <small><localize key="merchelloNotificationsEdit_emailTemplateHelper" /></small>
        </label>
        <div class="merchello-controls">
            <div class="row-fluid col-xs-8 span8">
                <label for="template"><localize key="merchelloNotificationsEdit_emailTemplateEditBody" /></label>
                <ng-form>
                    <umb-editor model="rteProperties"></umb-editor>
                </ng-form>
            </div>
        </div>
    </div>

     

    To this

    <div class="row-fluid">
        <div class="col-xs-8 span8">
            <label><localize key="merchelloNotificationsEdit_emailTemplateEditBody" /></label>
            <textarea rows="20" class="col-xs-12 span12" data-ng-model="notificationMessage.emailTemplateEditBody" />
        </div>
    </div>

     

    But the markup didn't appear in the textarea.  

    Thanks.

  • Trevor Loader 199 posts 256 karma points
    May 07, 2015 @ 23:53
    Trevor Loader
    0

    Whoops...ignore duplicate closing tbody/table tags in the example...copy/paste error!

  • DFBerry 53 posts 130 karma points
    May 08, 2015 @ 01:36
    DFBerry
    0

    Did you use the "source code" button (far left of RTE bar) to view/fix it? On the more complex emails, that is what I have to do.

  • Trevor Loader 199 posts 256 karma points
    May 08, 2015 @ 02:06
    Trevor Loader
    0

    Yep....did that but on save it moves the iteration tags.  Did you manage to get repeating table rows?  What version of Umbraco are you using?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 08, 2015 @ 18:12
    Rusty Swayne
    0

    Trevor - the RTE is validating the table and it is one of my to dos to give another option for formatting the message. Ultimate goal is to be able to create email messages with Razor views rather than using patterns.

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Sep 14, 2015 @ 10:29
    Biagio Paruolo
    0

    With Razor view, I suggest to use Postal MVC

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 14, 2015 @ 18:56
    Rusty Swayne
    0

    @Biagio - that is where I want to go with it but need to find some time to get it worked into the schedule.

    If you want to take a stab at getting it going, I'd love to help you get it in there! =)

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Sep 14, 2015 @ 20:03
    Biagio Paruolo
    0

    Hi,

    I know Postal because I use it in some my project. How can I help you?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 14, 2015 @ 20:50
    Rusty Swayne
    0

    We can't add a dependency that is not shipped with Umbraco ... that's one of the restrictions we've put on the Merchello project. It's just easier to stay on the same path if we don't introduce something that may not work in the future.

    I've been thinking of something along these lines:

    http://forums.asp.net/t/1888849.aspx?Render+PartialView+without+ControllerContext

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Sep 14, 2015 @ 21:16
    Biagio Paruolo
    0

    I'll give a read and try.

    I think that we can read source code of Postal to have an idea or see the code. It's opensource and works very well. Other commodity could be that "print views" must be edit from backoffice.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies