Announcement

Collapse
No announcement yet.

out of stock email notification

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

    out of stock email notification

    i know this has been touched upon a few times but ive never seen a final piece of code.

    where a product is out of stock, im trying to add a button which when clicked lauches the customers email client, prefills the 'to', 'subject' and main body fields. the email when sent by the customer is requesting to be notified when a product is back in stock.

    so far i have amended the 'send to a friend' code and entered into Act_OutOfStock.html template, copied below. this works well but i need to work on a few amendments...

    how do i auto generate the 'emailto' field (eg customerservices@mysite.com), how do i amend the subject to autoinclude the product name of the product item on which the email is generated. i cannot get the netquotevar to work in the subject field.

    many thanks.


    <!-- OutOfStock HTML begin -->
    <!-- This template is used for the out of stock message. -->

    <B><P class="actwarningcolor">NETQUOTEVAR:OUTOFSTOCK</P></B>


    <tr>
    <td colspan="2"><strong>Notify me when back in stock?</strong></td>
    </tr>
    <td width="120"> <input type=text value="Enter email" size="11" class="searchinput" onFocus="this.value='';" onChange="var thisloc=location.href; if (this.value != '') {location.href='mailto:' + this.value +'?subject=Out of stock&amp;body=Please notify me when ' + thisloc + ' is back in stock.'}"></td>
    <td width="50"> <input name="imageField" type="image" src="butt_go_white.gif"></td>

    <!-- This template is used for the out of stock message. -->
    <!-- OutOfStock HTML end -->

    #2
    netquotevar auto generate product name in email

    following my previous email i have solved the fields and copy the latest code below. but can anyone tell me how to auto generate the product name in the email?

    thanks


    <!-- OutOfStock HTML begin -->
    <!-- This template is used for the out of stock message. -->

    <B><P class="actwarningcolor">NETQUOTEVAR:OUTOFSTOCK</P></B>


    <tr>
    <A HREF="mailto:customerservices@mysite.com?subject=Back in stock notification email request NETQUOTEVAR:PRODUCTNAME&body=Please send me an email when this item is back in stock.">Notify me when this item is back in stock</A>
    </td>

    <!-- This template is used for the out of stock message. -->
    <!-- OutOfStock HTML end -->

    Comment


      #3
      This is the problem about getting NETQOTEVAR's into text strings.
      I've found a fudge to do this but I've always assumed there was a better way. I just put the NQV into a bit of Javascript like this:

      Code:
      <script language="JavaScript">
        <!--
          function genEMail(sDescription) 
          {
            if (sDescription!= "")
            {
              document.write("<tr> ");
              document.write("<A HREF=\"mailto:customerservices@mysite.com?subject=Back in stock notification email request " + sDescription+ "&body=Please send me an email etc.\">");
              ..  etc etc ...
              document.write("</tr>");
             }
          return null;
          }
          genEMail(NETQUOTEVAR:PRODUCTNAME);
        // -->
      </script>
      You can put the js function into one of the .js files.
      Be careful of the \" escape this allows you to put an actual double-quote character inside a js string (which is itself bounded by douoble-quotes)

      Alan

      Comment


        #4
        thanks for your email, Alan. can i see an example on your site as i dont understand which js file the code needs to go in and how its called from the out of stock template?

        paul

        Comment


          #5
          Paul,

          Have a look at any product on my site.
          I use this trick to generate the 'Out of Stock' message, the 'Contents' list, the 'Requires' and the 'Size' information (these last three are CUSTOMVARS).
          I have all the functions in a js file called akc.js which is referenced in the <head> section.

          You can just put the js code straight into a template - but any small changes mean all the pages will be regnerated - thats why I keep them in a file

          Alan Compton
          www.greenknightgames.co.uk
          Great board games and cards games you won't find in the High Street

          Comment

          Working...
          X