Announcement

Collapse
No announcement yet.

Content of v9_SendEmail

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Content of v9_SendEmail

    Need help! I am attempting to send an email from my template. I am using this template code:
    I cannot get any content into the content of the email.
    I would like to have some global content added to the email. Can't find a way to do it.

    Are the mvt:assigns for Title, description, and content below the call to SendEmail optional? Should they be removed if not used?
    I'm stumpted!

    Here is the template code:
    <mvt:assign name="l.email:to" value="'[email protected]'" />
    <mvt:assign name="l.email:from" value="'[email protected]'" />
    <mvt:assign name="l.email:headers" value="'Content-Type: text/html; charset=UTF-8'" />
    <mvt:assign name="l.email:subject" value="g.basket:basket_id" />

    <mvt:capture variable="l.email:message">
    <mvt:do file="g.Module_Feature_TUI_MGR" name="l.success" value="TemplateManager_Render_Page('email_template ')" />
    </mvt:capture>

    <mvt:assign name="l.email:message" value="glosub(l.email:message, '%email_title%', 'The Title')" />
    <mvt:assign name="l.email:message" value="glosub(l.email:message, '%email_description%', 'This is the description')" />
    <mvt:assign name="l.email:message" value="glosub(l.email:message, '%email_content%', 'g.shipemail')" />

    <mvt:do file="g.Module_Library_Utilities" name="l.success" value="v9_SendEmail(l.email)" />
    <mvt:if expr="l.success">
    Message Sent!
    <mvt:else>
    Error: Message not sent
    </mvt:if>
    Larry
    Luce Kanun Web Design
    www.facebook.com/wajake41
    www.plus.google.com/116415026668025242914/posts?hl=en



    #2
    Try using the l.settings namespace.

    Fore example:

    Code:
    <mvt:assign name="l.settings:email:to" value="'[email protected]'" />
    <mvt:assign name="l.settings:email:from" value="'[email protected]'" />
    <mvt:assign name="l.settings:headers" value="'Content-Type: text/html; charset=UTF-8'" />
    <mvt:assign name="l.settings:subject" value="g.basket:basket_id" />
    
    
    // etcetera
    http://www.alphabetsigns.com/

    Comment


      #3
      Hello Alpha:
      This is the part that I can't make any sense of.
      <mvt:assign name="l.email:message" value="glosub(l.email:message, '%email_title%', 'The Title')" />
      <mvt:assign name="l.email:message" value="glosub(l.email:message, '%email_description%', 'This is the description')" />
      <mvt:assign name="l.email:message" value="glosub(l.email:message, '%email_content%', 'g.shipemail')" />:

      Very frustrating for a php programmr to attempt miva template code!
      I'd love to see a working example
      Larry
      Luce Kanun Web Design
      www.facebook.com/wajake41
      www.plus.google.com/116415026668025242914/posts?hl=en


      Comment


        #4
        Code:
        <mvt:assign name="l.settings:email:to" value="'[email protected]'" />
        <mvt:assign name="l.settings:email:from" value="'[email protected]'" />
        <mvt:assign name="l.settings:email:headers" value="'Content-Type: text/html; charset=UTF-8'" />
        <mvt:assign name="l.settings:email:subject" value="g.basket:basket_id" />
        
        <mvt:capture variable="l.settings:email:message">
        <mvt:do file="g.Module_Feature_TUI_MGR" name="l.settings:has_page_template" value="TemplateManager_Render_Page('email_template ')" />
        </mvt:capture>
        
        <mvt:assign name="l.settings:email:message" value="glosub(l.settings:email:message, '%email_title%', 'The Title')" />
        <mvt:assign name="l.settings:email:message" value="glosub(l.settings:email:message, '%email_description%', 'This is the description')" />
        <mvt:assign name="l.settings:email:message" value="glosub(l.settings:email:message, '%email_content%', 'g.shipemail')" />
        
        <mvt:do file="g.Module_Library_Utilities" name="l.settings:has_email_sent" value="v9_SendEmail(l.settings:email)" />
        <mvt:if expr="l.settings:has_email_sent">
        Message Sent!
        <mvt:else>
        Error: Message not sent
        </mvt:if>
        http://www.alphabetsigns.com/

        Comment


          #5
          Thanks Alpha: Using your example I now have a subject in my email but nothing in he body. How would the body statements be formatted?
          They really puzzle me! Do they need to be defined prior to the capture? What do the % characters mean?

          <mvt:assign name="l.settings:email:message" value="glosub(l.settings:email:message, '%email_title%', 'The Title')" />
          <mvt:assign name="l.settings:email:message" value="glosub(l.settings:email:message, '%email_description%', 'This is the description')" />
          <mvt:assign name="l.settings:email:message" value="glosub(l.settings:email:message, '%email_content%', 'g.shipemail')" />

          Many thanks, Larry
          Larry
          Luce Kanun Web Design
          www.facebook.com/wajake41
          www.plus.google.com/116415026668025242914/posts?hl=en


          Comment


            #6
            The body is being rendered from a page template with the code 'email_template '. Do you have a page template with code 'email_template '?

            The % % symbols are generally used for tokenization. Does your 'email_template ' page have those tokens ?

            If the message is simple enough you could assign the body:

            Code:
            <mvt:assign name="l.settings:email:message" value="'This is The Title with This is a description being emailed to ' $  g.shipemail" />

            http://www.alphabetsigns.com/

            Comment


              #7
              Thanks again Alpha.
              I'm all set on this.
              By concatenating the basket_id, shiptoemail, and shipfinst name into the subject I have everything i need to know about customers.
              I'm using this to detect the credit card validators on our site. Just need to identify them and then blacklist them.
              Larry
              Luce Kanun Web Design
              www.facebook.com/wajake41
              www.plus.google.com/116415026668025242914/posts?hl=en


              Comment


                #8
                I'm glad you are able to get it to work.

                You may want to considering using your intellectual curiosity and take a look at Cloudflare free version.

                • Cloudflare provides a DNS service that is entirely free.
                • With its enormous edge network availability worldwide, Cloudflare provides a free content delivery network (CDN).
                • It provides a free SSL certificate, which allows you to convert an HTTP website to an HTTPS compatible webpage in seconds.
                • Cloudflare provides DDoS protection for free.
                • It provides free content caching, which speeds up page loading times.
                • It includes a firewall service that is included in the Cloudflare free plan. You can use this to block bots, traffic from specified countries, and IP addresses, among other things.
                Here's a few links:

                https://www.cloudflare.com/en-gb/plans/free/

                Youtube:
                https://www.youtube.com/user/cloudflare/videos

                Bot Management:
                https://www.youtube.com/watch?v=cnUhnfGVWu8

                It's free.

                http://www.alphabetsigns.com/

                Comment

                Working...
                X