2 Replies Latest reply on Nov 23, 2012 8:15 AM by Dan Bracuk

    Email Notification

    wycks Level 1

      Hi,

       

      I'm trying to figure out a way to notify someone that another person has replied to a post they made in a discussion.  I'm pretty sure I know how to figure out who the email should be sent to, but for now I'm just trying to get it to work by just sending it to my personal email.  This is the code I'm trying to get to work:

       

      Thanks,

      Mike

      ======================================================================

                        <cfif isDefined("FORM.title")>

       

        <cfprocessingdirective suppresswhitespace="No">

            <span class="blogtitle">Your Email has been sent.<br><br>I'll get back to you as soon as I can.

          </span>

         

        <cfmail

                          TO="mikewycklendt@gmail.com"

              from="""#FORM.username#"" <mikewycklendt@mymindsnotright.com>"

              subject="#FORM.title#"

              server="scriptmail.intermedia.net"  

              >This is a message from #FORM.username#:

      Email: #FORM.username#

      -------------------------------------------------

      #FORM.content#

       

       

      </cfmail>

         

          </cfprocessingdirective>

       

       

       

       

        <cfelse>

       

       

      <form method="post" name="form1" action="<cfoutput>#CurrentPage#</cfoutput>">

                          <table align="center" cellpadding="4">

                            <tr valign="baseline">

                              <td colspan="2" align="left" nowrap bgcolor="#FFFFFF" class="blogtitle"> </td>

                              </tr>

                            <tr valign="baseline">

                              <td align="right" nowrap class="bloguserandwho"> </td>

                              <td><input type="hidden" name="user_id" value="<cfoutput>#rsGetUserID.user_id#</cfoutput>" size="32"></td>

                            </tr>

                            <tr valign="baseline">

                              <td align="right" nowrap class="bloguserandwho">Username:</td>

                              <td><input type="hidden" name="username" id="username" value="<cfoutput>#Session.MM_Username#</cfoutput>" size="32" />                          <cfoutput>#Session.MM_Username#</cfoutput>

                               

                               

                               

                               

                               

                                </td>

                            </tr>

                            <tr valign="baseline">

                              <td align="right" nowrap class="bloguserandwho">Title:</td>

                              <td><input type="text" name="title" id="title" value="" size="32"></td>

                            </tr>

                            <tr valign="baseline">

                              <td align="right" valign="top" nowrap class="bloguserandwho">Content:</td>

                              <td><textarea name="content"  id="content" cols="30" rows="5"></textarea></td>

                            </tr>

                            <tr valign="baseline">

                              <td nowrap align="right"> </td>

                              <td><input type="submit" value="Post Reply"></td>

                            </tr>

                          </table>

          <input type="hidden" name="reply_id" value="<cfoutput>#IncrementValue(rsReplyRecordCount.RecordCount)#</cfoutput>">

                          <input type="hidden" name="post_id" value="<cfoutput>#URL.post_id#</cfoutput>">

                          <input type="hidden" name="board_id" value="1">

                          <input type="hidden" name="date" value="<cfoutput>#now()#</cfoutput>">

                          <input type="hidden" name="MM_InsertRecord" value="form1">

                        </form>

                                 </cfif>