Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jul 25, 2013 @ 11:29
    Ismail Mayat
    0

    Latest contour

    Will this work with latest version of contour v3 if not would it be possible to get the source so I can rebuild.

    Regards

    Ismail

  • Michael Lawrence 128 posts 200 karma points
    Jul 25, 2013 @ 15:45
    Michael Lawrence
    101

    I haven't tested this in ages, but sure, the source can be found here:

    https://bitbucket.org/liquidplastik/pandemicode-umbraco-extensions

    It could probably be rewritten better now that Umbraco has better Razor support.

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jul 25, 2013 @ 16:06
    Ismail Mayat
    0

    Micheal,

    It all works. Thanks for the source link. 

    Regards

    Ismail

  • Osman Coskun 164 posts 398 karma points
    Dec 10, 2013 @ 10:46
    Osman Coskun
    0

    Hi Ismail,

    Current version on our.umbraco.org seems not working. Did you manage to rebuild the package? If yes can you share please?


    Thanks

    Osman 

  • keilo 568 posts 1023 karma points
    Sep 10, 2015 @ 16:21
    keilo
    0

    The download link for the source seems to be dead.

    Anyone managed to get this working on the v7?

    Would appreciate if you can share the source / build

  • Michael Lawrence 7 posts 27 karma points
    Sep 11, 2015 @ 01:11
    Michael Lawrence
    1

    Hey Keilo,

    I had renamed my Bitbucket account but have since moved to Github. It used to be a Mercurial repo, so I just copied it over to a Git repo on Github for you. Here's the link:

    https://github.com/michael-lawrence/pandemicode-umbraco-extensions

    Feel free to do what you want with it. :)

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 11, 2015 @ 03:05
    Nicholas Westby
    0

    Michael! Long time no see. Haha.

    Look what you're missing out on at Rhythm: https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/69933-replacing-contour-umbraco-forms-with-something-better

    Well, it'll be open source, so I suppose you won't be missing much :-)

    Missing It

  • keilo 568 posts 1023 karma points
    Sep 11, 2015 @ 10:28
    keilo
    0

    Hey Michael

    Thanks for taking the time to put this up on Github.

    On a version 7 install, one only needs to copy the RazorEngine.dll to the /bin folder for this to show up on the Contour. Understand this is pre-v7 and razor support built-int, nevertheless the site doesnt break and workflow shows up on the Contour.

    The issue is when i select the sample razor file to send the e-mail, accepts it but no email is send. I presume this is to do with the razor code inside the sample file?

    Do I need to update anything in this sample file, to make it happy with the version 7?

    @* This file has been renamed with a .txt extension for viewing purposes only. *@
    
    @{  
        

    Intro

    This is a sample email using razor to convert a record into a custom email

    Here you can get specific records and format them accordingly:

    string name = Model.Record.GetRecordField("Name").ValuesAsString(); string email = Model.Record.GetRecordField("Email").ValuesAsString(); string message = Model.Record.GetRecordField("Message").ValuesAsString();

    Name: @name

    Email: @email

    Message: @message

    Here you can recurse the fields within the record:

      @foreach (var r in Model.Record.RecordFields) {
    • Caption: @r.Value.Field.Caption

      @r.Value.ValuesAsString()

    • }
    }

    Many thanks!

  • Michael Lawrence 7 posts 27 karma points
    Sep 11, 2015 @ 17:42
    Michael Lawrence
    0

    It's been so long since I've used this I'm not sure, but I don't recall having to modify it. Do you have your SMTP settings set up in your web.config? It uses the SmtpClient class to send emails.

  • Michael Lawrence 7 posts 27 karma points
    Sep 11, 2015 @ 17:44
    Michael Lawrence
    0

    Hey Nick! Definitely! I haven't been spending as much time doing Umbraco development lately. I've basically been doing pure JavaScript with all my time. Looks like you've got your work cut out for you. :) Have you guys begun working on this yet? Nice Office Space reference too, haha!

  • keilo 568 posts 1023 karma points
    Sep 11, 2015 @ 17:50
    keilo
    0

    Hey Michael

    Yes I have the SMTP setup and working, I have other send email workflow (default) and this. The first one is sending the email but the second isnt.

    As I copied the RazorEngine.dll to the /bin folder of the Umbraco 7

    do you think the sample razor needs to be updated to get the values?

    like, if Model.Record.GetRecordField will still work..

     string name = Model.Record.GetRecordField("Name").ValuesAsString();
    
  • Michael Lawrence 7 posts 27 karma points
    Sep 11, 2015 @ 18:04
    Michael Lawrence
    0

    Hey Keilo,

    It's possible. I haven't been developing for Umbraco/Contour for a bit so I'm not sure if there have been API changes. You might also need to update the RazorEngine library as well. I would skim over the source code as well and make sure it still adheres to the latest Contour API.

  • keilo 568 posts 1023 karma points
    Sep 11, 2015 @ 18:10
    keilo
    0

    Thanks Michael.

    I was curious how Ismail get it working, as he didnt mention of any change in razor code but rather re-compile.

    I'll go through the code, and perhaps learn more about it

    cheers!

  • Michael Lawrence 7 posts 27 karma points
    Sep 11, 2015 @ 18:22
    Michael Lawrence
    1

    It's pretty simple (less than 80 lines of actual code). Basically it just reads the cshtml file specified and parses it with the RazorEngine library and passes in the Contour record as it's context. Next it creates a MailMessage and sets the body to the output of the RazorEngine's parse method. Finally it creates an SMTPClient and sends the MailMessage.

    Good luck and feel free to ask any questions you may have. :)

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 11, 2015 @ 19:48
    Nicholas Westby
    0

    Pure JavaScript is an oxymoron :-P

    Sounds like fun though :-)

    I had begun working on it before it became a work project. Now that it has a few weeks of time assigned to it, I may scrap what I have so far so I can make sure everything is setup properly for the new scope (and probably put it under the Rhythm github account).

Please Sign in or register to post replies

Write your reply to:

Draft