Copied to clipboard

Flag this post as spam?

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


  • Ove Andersen 435 posts 1541 karma points c-trib
    Jul 13, 2010 @ 14:00
    Ove Andersen
    0

    Page name in subject and message does not work

    I am trying to make a custom email form using Doc2Form. Everything works, except the part where I try to insert the pageName of the current page in the subject and the message.

    Here is the macro:

    <umbraco:Macro DocumentType="2495" TabName="data" PageTabs="0" HideTabNames="1" ShowDescriptions="0" RequiredText="" SubmitButtonText="Send" PreviousButtonText="" NextButtonText="" TextOnSubmit="Forespørselen har blitt sendt." RedirectToNode="" StorePropertiesInCookies="" SendEmailResponse="0" ResponseSubject="" ResponseMessage="" ResponseEmailFieldAlias=", " ResponseCopyTo="" EmailForm="1" FormSubject="[Name] needs [#pageName]" FormMessage="[Name] wants [Count] pc. [#pageName].
    T: [Phone]
    E: <a href='mailto:[Email]'>[Email]</a>" FormToEmailAddress="ove@eyecatch.no" FormFromEmailAddress="postmaster@eyecatch.no" UseAjax="0" DefaultValueNode="" Alias="Doc2FormEmail" runat="server"></umbraco:Macro>

    And here is the resulting email:

    Subject:
    Ove Andersen needs [#pageName]
    Message:
    Ove Andersen wants 1 pc. [#pageName].

    T: 99016610
    E: ove.a@online.no

    Anyone have a clue why it does not work?

    I am successfully using the [#pageID] in the ChooseWhereToStore parameter in another form on my website.

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jul 13, 2010 @ 14:14
    Sebastiaan Janssen
    1

    I'm not familiar with doc2form, but this looks okay. Maybe you're supposed to just send the [#pageName] as a macro parameter, without the rest of the string?

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jul 13, 2010 @ 14:20
    Ove Andersen
    0

    Yes. It works when only using [#pageName] as parameter value.

    Maybe I need to dig into the Doc2Form source code to fix this issue...

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jul 13, 2010 @ 14:23
    Sebastiaan Janssen
    0

    Maybe it's possible on the other end to concat some strings (or better yet, string.Format them or something like that)?

  • bob baty-barr 1180 posts 1294 karma points MVP
    Jul 13, 2010 @ 16:52
    bob baty-barr
    0

    Ove... try moving all your email template logic into a dictionary item... i have noticed some goofiness when trying to put all your output for the email text into the macro itself... certain characters tend to break things.

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jul 15, 2010 @ 19:17
    Ove Andersen
    0

    @bob Tried that now. Didn't work. [#pageName] and [#pageID] are still not replaced by the proper text.

  • bob baty-barr 1180 posts 1294 karma points MVP
    Jul 16, 2010 @ 01:40
    bob baty-barr
    0

    @Ove...

    here is a snippet of syntax i have used in a dictionary item.... this is using fields from the form itself... just using bracket syntax...

    Dear [regNameWebinar],

    Thank you very much for registering for our free webinar: [CourseTitleWebinar] on [CourseSessionWebinar]. You should receive an email one week prior to the scheduled webinar that will include a link to the site and audio conference dial-in information. If you should not receive this information or should have any...

     

    and here is a snippet from my macro insertion...

    ResponseSubject="Thank you for Registering for [CourseTitle]..." ResponseMessage="#courseEmail" ResponseEmailFieldAlias="regEmail" ResponseCopyTo="TSGUniversity@4tsg.com" UseAjax="0" FormSubject="Course Registration for [CourseTitle]" DefaultValueDocs="[#pageID]"

     

    of course... none of these are using umbraco properties... except for the defaultValueDocs...

    hope this gets you a bit closer to what you want.

  • Ove Andersen 435 posts 1541 karma points c-trib
    Jul 23, 2010 @ 21:35
    Ove Andersen
    0

    It seems the problem is either in Doc2Form or in the way Umbraco handles those macro parameter values.

    The problem is at least possible to solve in Doc2Form, so I have added a few changes to the Doc2Form source code. It now supports passing a value from the current page (like [#pageID]), passing a value from the request collection (like [@querystringkey]) as well as passing a cookie value (like [%cookiekey]).

    This is only running on locally on my server at the moment, but I will merge my changes to Codeplex when I get a better internet connection (and access). :-)

  • Ove Andersen 435 posts 1541 karma points c-trib
    Aug 04, 2010 @ 13:02
    Ove Andersen
    0

    This problem is solved with changeset 52448.

    http://umbracoext.codeplex.com/SourceControl/changeset/changes/52448

  • 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