title: Post Confirmation ConfirmForgotPassword lambda execution returns InvalidLambdaResponseException - Unrecognizable lambda output
body: <p>I have spent a bunch of hours to solve this issue, all related SO answers seem to be outdated or irrelevant.</p>
  <p>State:</p>
  <ul>
  <li><p>Amplify.js &quot;^4.3.10&quot; with code</p>
  <pre><code>     Auth.forgotPasswordSubmit(email, confirmationCode, password)
       .then(_ =&gt; this.notification.success(&quot;Confirmation OK&quot;))
       .catch(err =&gt; console.log(err));
  </code></pre>
  </li>
  <li><p>Lambda on Node.js 14</p>
  </li>
  <li><p>Cognito trigger &quot;Post confirmation&quot;</p>
  </li>
  </ul>
  <p>Lambda function code:</p>
  <pre><code>'use strict';
  
  exports.handler = async (event, context, callback) =&gt; {
      if (event.triggerSource === &quot;PostConfirmation_ConfirmForgotPassword&quot;) {
        const postConfirmEmail = () =&gt; `&lt;html&gt;&lt;body&gt;HERE IS MY TEMPLATE&lt;/body&gt;&lt;/html&gt;`;
      
        event.response = {
            emailSubject: &quot;Reset Password Notification&quot;,
            emailMessage: postConfirmEmail()
        };
        
        callback(null, event);
      } 
  };
  </code></pre>
  <p>As result, I am getting
  <strong>InvalidLambdaResponseException: Unrecognizable lambda output (Error 400)</strong></p>
  <p>The thing is that password is really updating as expected, but e-mail confirmation is NOT sent and error remains.</p>
  <p>TIP: User is CONFIRMED. Tried also with &quot;context.done(null, event);&quot; / &quot;return event;&quot; but response is always with the same error.</p>