5 Replies Latest reply: Jul 11, 2013 8:55 AM by RMishra RSS

    Email template shows "null" password from ForgotPasswordHandler

    Jagadeesh.P.B

      Hi,

      I have configured ForgotPasswordHandler with

      templateEmailSender=/atg/userprofiling/email/TemplateEmailSender

      profileTools=/atg/userprofiling/ProfileTools

      newPasswordParam=newpassword

      loggingDebug=true

      loggingInfo=true

       

      # The URL of the email template jsp/jhtml page

      templateURL=/prototype/emailtemplates/forgot_password_email.jsp

      # Subject field of the email

      messageSubject=Forgot Password Email

      # From field of the email

       

      messageFrom^=/atg/dynamo/service/SMTPEmail.defaultFrom

      # MessageContentProcessor responsible for processing the content

      contentProcessor=/atg/userprofiling/email/HtmlContentProcessor

       

      Whenever I try to hit the forgotPassword method of the ForgotPasswordHandler from the jsp, I could see the below log

      16:36:25,773 INFO  [ForgotPasswordHandler] DEBUG Key is newpassword

      16:36:25,773 INFO  [ForgotPasswordHandler] DEBUG Value is gjKZxJ

      16:36:25,774 INFO  [TemplateEmailSender] DEBUG sendEmailMessage invoked.

      16:36:25,774 INFO  [TemplateEmailSender] DEBUG registered email request EmailRequest[atg.userprofiling.email.TemplateEmailInfoImpl@37d8ef10(mailingId=null, messageSubject=Requested Password)] with synchronization EmailSynchronization[TransactionImple < ac, BasicAction: 7f000001:2b92:51dd3ef5:db8 status: ActionStatus.RUNNING >]

      16:36:25,774 INFO  [ForgotPasswordHandler] DEBUG Successfully completed: null contents of value are:

      16:36:25,775 INFO  [ForgotPasswordHandler] DEBUG name=email value=dummy123@gmail.com class="java".lang.String

      16:36:25,775 INFO  [TemplateEmailSender] DEBUG email synchronization EmailSynchronization[TransactionImple < ac, BasicAction: 7f000001:2b92:51dd3ef5:db8 status: ActionStatus.COMMITTED >] queueing email requests

      16:36:25,776 INFO  [TemplateEmailSender] DEBUG de-queued email request EmailRequest[atg.userprofiling.email.TemplateEmailInfoImpl@37d8ef10(mailingId=null, messageSubject=Requested Password)] Queue size = 0

      16:36:25,777 INFO  [TemplateEmailSender] DEBUG queued email request EmailRequest[atg.userprofiling.email.TemplateEmailInfoImpl@37d8ef10(mailingId=null, messageSubject=Requested Password)] Queue size = 0

      16:36:25,851 INFO  [TemplateEmailSender] DEBUG created session atg.servlet.sessiontracking.GenericHttpSession@1b683c7e with id 53F441CC033AFD8986E6BB849D92C49A parent session id = 53F441CC033AFD8986E6BB849D92C49A, cookieString = JSESSIONID=53F441CC033AFD8986E6BB849D92C49A

      16:36:25,852 INFO  [TemplateEmailSender] DEBUG rendering path info /teleflora/prototype/emailtemplates/forgot_password_email.jsp;jsessionid=53F441CC033AFD8986E6BB849D92C49A

      16:36:25,861 INFO  [TemplateEmailSender] DEBUG rendered template has content type text/html;charset=UTF-8

      16:36:25,861 INFO  [TemplateEmailSender] DEBUG Preparing to create message with text:  <HTML> <HEAD> <TITLE>Your new password</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" VLINK="#637DA6" LINK="#E87F02"> <font face="verdana" size=2>Dear jbalasubramanian , <p>Here is your login information with a new passord. <p>Login: dummy123@gmail.com <p><b>New password: null</b> </font> </body> </html>

      16:36:25,862 INFO  [TemplateEmailSender] DEBUG Encoding UTF-8 No mapping found

      16:36:25,862 INFO  [TemplateEmailSender] DEBUG creating message to user:150000 (dummy123@gmail.com), contentType = text/html;charset=UTF-8

      16:36:25,879 INFO  [TemplateEmailSender] DEBUG doSendEmailMessage: numMessages = 1

      16:36:25,880 INFO  [STDOUT] DEBUG: setDebug: JavaMail version ${mail.version}

      16:36:25,880 INFO  [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]

      16:36:25,881 INFO  [SMTPEmail] DEBUG Attempting to open a connection...

      16:36:25,881 INFO  [STDOUT] DEBUG SMTP: useEhlo true, useAuth false

      16:36:25,882 INFO  [STDOUT] DEBUG SMTP: trying to connect to host "172.31.1.23", port 25, isSSL false

       

      I have overridden FormHandler to print password and it's getting printed. But the email template jsp which uses request.getParameter("newpassword") shows it as null.

      What could be wrong?

        • 2. Re: Email template shows "null" password from ForgotPasswordHandler
          Jagadeesh.P.B

          I have done the configurations mentioned in https://forums.oracle.com/thread/2524821

          And have updated web.xml to have

          <context-param>
            <param-name>atg.session.parentContextName</param-name>
            <param-value>/dyn</param-value>
              </context-param>

          As mentioned in https://forums.oracle.com/thread/2512572

          But still the password in the email is null. Not sure what I'm doing wrong. The jsessionID is also the same when it reaches the template processing, as we can see from the logs.

          • 3. Re: Email template shows "null" password from ForgotPasswordHandler
            Jagadeesh.P.B

            I tried to extend TemplateEmailSender to add more logs to see if template parameters reach there and it does

            4:38:05,682 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0 (build: SVNTag=JBPAPP_5_1_0 date=201009150028)] Started in 1m:1s:636ms

            14:38:32,811 INFO  [ForgotPasswordHandler] DEBUG Key is newpassword

            14:38:32,814 INFO  [ForgotPasswordHandler] DEBUG Value is QsJDdZ

            14:38:32,815 INFO  [TemplateEmailSender] DEBUG sendEmailMessage invoked.

            14:38:32,880 INFO  [TemplateEmailSender] DEBUG created session atg.servlet.sessiontracking.GenericHttpSession@5b7ef6d4 with id 500A51E822CB05E87F63F3888269190B parent session id = 500A51E822CB05E87F63F3888269190B, cookieString = JSESSIONID=500A51E822CB05E87F63F3888269190B

            14:38:32,895 INFO  [TemplateEmailSender] DEBUG rendering path info /teleflora/prototype/emailtemplates/forgot_password_email.jsp;jsessionid=500A51E822CB05E87F63F3888269190B

            14:38:33,045 INFO  [TemplateEmailSender] DEBUG rendered template has content type text/html;charset=UTF-8

            14:38:33,046 INFO  [TemplateEmailSender] DEBUG Preparing to create message with text:  <HTML> <HEAD> <TITLE>Your new password</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" VLINK="#637DA6" LINK="#E87F02"> <font face="verdana" size=2>Dear jbalasubramanian , <p>Here is your login information with a new passord. <p>Login: dummy123@gmail.com <p><b>New password: null</b> </font> </body> </html>

            14:38:33,081 INFO  [TemplateEmailSender] DEBUG Encoding UTF-8 No mapping found

            14:38:33,081 INFO  [TemplateEmailSender] DEBUG creating message to user:150000 (dummy123@gmail.com), contentType = text/html;charset=UTF-8

            14:38:33,236 INFO  [TemplateEmailSender] DEBUG doSendEmailMessage: numMessages = 1

            14:38:33,241 INFO  [STDOUT] DEBUG: setDebug: JavaMail version ${mail.version}

            14:38:33,245 INFO  [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]

            14:38:33,273 INFO  [SMTPEmail] DEBUG Attempting to open a connection...

            14:38:33,273 INFO  [STDOUT] DEBUG SMTP: useEhlo true, useAuth false

            14:38:33,273 INFO  [STDOUT] DEBUG SMTP: trying to connect to host "172.31.1.23", port 25, isSSL false

            14:38:33,815 INFO  [STDOUT] 220 ***************************************************************************************

            14:38:33,816 INFO  [STDOUT] DEBUG SMTP: connected to host "172.31.1.23", port: 25

            14:38:33,818 INFO  [STDOUT] EHLO tfdevvm

            14:38:34,094 INFO  [STDOUT] 250-mail.mcfadyen.com Hello [172.31.51.103]

            250-SIZE

            250-PIPELINING

            250-DSN

            250-ENHANCEDSTATUSCODES

            250-AUTH NTLM

            250-8BITMIME

            250-BINARYMIME

            250 XXXXXXXA

            14:38:34,094 INFO  [STDOUT] DEBUG SMTP: Found extension "SIZE", arg ""

            14:38:34,094 INFO  [STDOUT] DEBUG SMTP: Found extension "PIPELINING", arg ""

            14:38:34,094 INFO  [STDOUT] DEBUG SMTP: Found extension "DSN", arg ""

            14:38:34,095 INFO  [STDOUT] DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""

            14:38:34,095 INFO  [STDOUT] DEBUG SMTP: Found extension "AUTH", arg "NTLM"

            14:38:34,095 INFO  [STDOUT] DEBUG SMTP: Found extension "8BITMIME", arg ""

            14:38:34,095 INFO  [STDOUT] DEBUG SMTP: Found extension "BINARYMIME", arg ""

            14:38:34,095 INFO  [STDOUT] DEBUG SMTP: Found extension "XXXXXXXA", arg ""

            14:38:34,095 INFO  [STDOUT] NOOP

            14:38:39,363 INFO  [STDOUT] 250 2.0.0 OK

            14:38:39,365 INFO  [STDOUT] NOOP

            14:38:44,632 INFO  [STDOUT] 250 2.0.0 OK

            14:38:44,659 INFO  [STDOUT] DEBUG SMTP: use8bit false

            14:38:44,659 INFO  [STDOUT] MAIL FROM:<SystemAdmin@teleflora.com>

            14:38:44,942 INFO  [STDOUT] 250 2.1.0 Sender OK

            14:38:44,942 INFO  [STDOUT] RCPT TO:<dummy123@gmail.com>

            14:38:45,228 INFO  [STDOUT] 250 2.1.5 Recipient OK

            14:38:45,229 INFO  [STDOUT] DEBUG SMTP: Verified Addresses

            14:38:45,229 INFO  [STDOUT] DEBUG SMTP:   dummy123@gmail.com

            14:38:45,229 INFO  [STDOUT] DATA

            14:38:45,502 INFO  [STDOUT] 354 Start mail input; end with <CRLF>.<CRLF>

            14:38:45,509 INFO  [STDOUT] Date: Thu, 11 Jul 2013 14:38:44 +0530 (IST)

            From: SystemAdmin@teleflora.com

            To: dummy123@gmail.com

            Message-ID: <1727815539.1.1373533724657.JavaMail.ATG{profileId=150000}@tfdevvm>

            Subject: Requested Password

            MIME-Version: 1.0

            Content-Type: multipart/alternative;

                boundary="----=_Part_0_816289581.1373533713225"

             

            ------=_Part_0_816289581.1373533713225

            Content-Type: text/plain;charset=UTF-8

            Content-Transfer-Encoding: 7bit

             

            Dear jbalasubramanian ,

             

            Here is your login information with a new passord.

             

            Login: dummy123@gmail.com

             

            New password: null

            ------=_Part_0_816289581.1373533713225

            Content-Type: text/html;charset=UTF-8

            Content-Transfer-Encoding: 7bit

             

             

            <HTML> <HEAD>

            <TITLE>Your new password</TITLE>

            </HEAD>

            <BODY BGCOLOR="#FFFFFF" VLINK="#637DA6" LINK="#E87F02">

            <font face="verdana" size=2>Dear

            jbalasubramanian

            ,

            <p>Here is your login information with a new passord.

            <p>Login: dummy123@gmail.com

            <p><b>New password: null</b>

            </font>

            </body>

            </html>

             

            ------=_Part_0_816289581.1373533713225--

            .

            14:38:45,950 INFO  [STDOUT] 250 2.6.0 <1727815539.1.1373533724657.JavaMail.ATG{profileId=150000}@tfdevvm> Queued mail for delivery

            14:38:45,951 INFO  [TemplateEmailSender] DEBUG email sent to user:150000 (dummy123@gmail.com)

            14:38:45,952 INFO  [STDOUT] NOOP

            14:38:51,220 INFO  [STDOUT] 250 2.0.0 OK

            14:38:51,221 INFO  [STDOUT] QUIT

            14:38:51,498 INFO  [STDOUT] 221 2.0.0 Service closing transmission channel

            14:38:51,537 INFO  [TemplateEmailSender] DEBUG Im going to print template parameters whose size is 1

            14:38:51,537 INFO  [TemplateEmailSender] DEBUG The key from tmplParams is newpassword

            14:38:51,537 INFO  [TemplateEmailSender] DEBUG The value from tmplParams is QsJDdZ

            14:38:51,537 INFO  [ForgotPasswordHandler] DEBUG Successfully completed: null contents of value are:

            14:38:51,537 INFO  [ForgotPasswordHandler] DEBUG name=email value=dummy123@gmail.com class="java".lang.String

            • 4. Re: Email template shows "null" password from ForgotPasswordHandler
              Jagadeesh.P.B

              Problem solved. I was using request.getParameter("newpassword") as suggested in other forums. When I switched to <dsp:valueof param="newpassword">null</dsp:valueof>, it worked

              • 5. Re: Email template shows "null" password from ForgotPasswordHandler
                RMishra

                You can make this thread as answered. So others can refer this.