Getting e-mail ID dynamically?

Options

Is there a way to determine the e-mail ID using some sort of tag-based approach?  I've tried various combinations of tags, like ] 270 276 substring]]]]]] for example, and it works more or less in "preview" mode, but when I sent the test e-mail to myself, the the content was null.  Besides, there's not way to be sure the 6 characters that extracts will always be in the exact same posistion, so even if it did work in the e-mail, it's probably not the right solution anyway.

The issue is that we use these strings to include social networking links in emails.  Since they have to be configured per e-mail, it means lots of extra work each time to make sure the links are right.  I'm trying to find a way to drop these links into stationary instead so we don't have to remember to set it up each time,  but I've been unable to figure a way to pull the em_id value or even way to link to any custom page at all in such a way that the em_id value is somewhere in the URL string (so I can  parse out the ID and redirect links to the real MessageViewer servlet).

Anyone have any ideas or tips?

Tagged:

Comments

  • There is not an S-Tag to get the em_id, though that is a feature request I've opened. I believe the only option is the one I've outlined at http://community.customer.convio.com/message/5804Re: Email and the MessageViewer Application

  • Noah Cooper:

    There is not an S-Tag to get the em_id, though that is a feature request I've opened. I believe the only option is the one I've outlined at http://community.customer.convio.com/message/5804Re: Email and the MessageViewer Application

    Ok, so just to clarify:

    ]x::<a href="http://www.facebook.com/share.php?u=http://www.foo.org/site/MessageViewer?em_id=]">Share on Facebook</a>::<a href="http://www.foo.org/site/MessageViewer/FaceBook">Share on Facebook</a>]]

    This goes....  where?  The stationary? What application is 42?  The application that poses the question of life, the universe and everthing?

    I need to understand what to put in the actual e-mail...  The idea being they can share the message on Facebook and/or Twitter with a single click...

    hmm.  Theres the problem of using a short URL for twitter too.

    What about a PageBuilder page?  You could redirect from the MessageViewer via JavaScript with the em_id in the querystring, then scrape the content from the MV page and re-present it.  The PageBuilder page could, also, use the AJAX proxy mechanim to generate a bit.ly or is.gd URL for Twitter at the same time.  Then....... if the Facebook link was clicked, redirect again to FB, and if it was the Twitter one, go there...  But it all hinges on having the e-mail ID as input...

  • Michael :

    Ok, so just to clarify:

    ]x::<a href="http://www.facebook.com/share.php?u=http://www.foo.org/site/MessageViewer?em_id=]">Share on Facebook</a>::<a href="http://www.foo.org/site/MessageViewer/FaceBook">Share on Facebook</a>]]

    This goes....  where?  The stationary? What application is 42?  The application that poses the question of life, the universe and everthing?

    I need to understand what to put in the actual e-mail...  The idea being they can share the message on Facebook and/or Twitter with a single click...

    hmm.  Theres the problem of using a short URL for twitter too.

    What about a PageBuilder page?  You could redirect from the MessageViewer via JavaScript with the em_id in the querystring, then scrape the content from the MV page and re-present it.  The PageBuilder page could, also, use the AJAX proxy mechanim to generate a bit.ly or is.gd URL for Twitter at the same time.  Then....... if the Facebook link was clicked, redirect again to FB, and if it was the Twitter one, go there...  But it all hinges on having the e-mail ID as input...

    That can go in either the Stationery or the message itself (though would probably make more sense to put it in the Stationery for reusability's sake). 42 is the app. ID for MessageViewer. You could make the request to the is.gd API in MessageViewer, no need to involve PageBuilder -- in the example I provided on the other Community post, the idea was to change window.location onload, but you could instead first get the shortened URL then do the redirect afterward:

    ]::/Twitter::

    ]

    <script type="text/javascript">

    $(function(){

        $.ajax({

            type:'GET',

            dataType:'html',

            url:'AjaxProxy?cnv_url=]/site/MessageViewer?em_id=]]]]]&auth=]',

            success:function(shortURL){

                window.location='http://twitter.com/?status='+shortURL;

            }

        });

    });

    </script>

    ::]]

    You'd probably want to add CSS to hide the body of the page while the AJAX request is made (and maybe add some kind of loading graphic). If you want to get the message's subject line to include in the tweet with the link, you could do document.title.split('Email - ').

  • Noah Cooper:

    That can go in either the Stationery or the message itself (though would probably make more sense to put it in the Stationery for reusability's sake). 42 is the app. ID for MessageViewer. You could make the request to the is.gd API in MessageViewer, no need to involve PageBuilder -- in the example I provided on the other Community post, the idea was to change window.location onload, but you could instead first get the shortened URL then do the redirect afterward:

    ]::/Twitter::

    ]

    <script type="text/javascript">

    $(function(){

        $.ajax({

            type:'GET',

            dataType:'html',

            url:'AjaxProxy?cnv_url=]/site/MessageViewer?em_id=]]]]]&auth=]',

            success:function(shortURL){

                window.location='http://twitter.com/?status='+shortURL;

            }

        });

    });

    </script>

    ::]]

    You'd probably want to add CSS to hide the body of the page while the AJAX request is made (and maybe add some kind of loading graphic). If you want to get the message's subject line to include in the tweet with the link, you could do document.title.split('Email - ').

    BTW, if you didn't already know, the U6 tag is used to include a JavaScript file on the fly. Change js/jquery.min.js to the actual path to jQuery on your site (or use some other library!)

  • Noah Cooper:

    BTW, if you didn't already know, the U6 tag is used to include a JavaScript file on the fly. Change js/jquery.min.js to the actual path to jQuery on your site (or use some other library!)

    a library other than jQuery?  why in the world would anyone do that?

    Thanks for the info, I'll give it a whirl and let you know

    -mike

Categories