title: AWS cognito user pools, custom message lambda
body: <p>Good day to everyone.</p>
  
  <p>I have a problem with AWS cognito user pools custom message which is created inside lambda function as a trigger (custom message lambda). Message with verification link inside. In particular I'm setting message subject to "Custom subject" (and email has this subject), and message body to "Use this {##Custom link##} instead" (and the message is not appear in the body, but the one from user pools web interface is used).</p>
  
  <p>My code is:</p>
  
  <pre><code>public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException {
      JsonNode json = parseJsonFromStream(input);
      ObjectNode jsonWithResponse = (ObjectNode) json;
      jsonWithResponse.with("response").put("emailMessage", "Use this {##Custom link##} instead");
      jsonWithResponse.with("response").put("emailSubject", "Custom subject");
      try (Writer w = new OutputStreamWriter(output, "UTF-8")) {
              w.write(jsonWithResponse.toString());
      }
  }
  </code></pre>
  
  <p>I had tried to set even {####} instead {##Link text##} and still same. I'm almost sure it worked some time ago (and I don't remember I changed anything). Does anyone has any idea where should I take a look (dig). As I spent too much time on that and neither missing something (hopefully) small or they have some changes/issues.</p>
  
  <p>P.S. lambda test success. Lambda output looks fine (I eliminate logger here). </p>
  
  <p>Upd: (logger output with response)</p>
  
  <pre><code>OUTPUT JSON is
  {
      "version": "1",
      "region": "eu-west-1",
      "userPoolId": "****",
      "userName": "*****",
      "callerContext": {
          "awsSdkVersion": "aws-sdk-android-2.6.7",
          "clientId": "****"
      },
      "triggerSource": "CustomMessage_SignUp",
      "request": {
          "userAttributes": {
              "sub": "****",
              "email_verified": "false",
              "cognito:user_status": "UNCONFIRMED",
              "nickname": "Yaroslav",
              "email": "****"
          },
          "codeParameter": "{####}",
          "usernameParameter": null
      },
      "response": {
          "emailMessage": "Use this {##Custom link##} instead",
          "emailSubject": "Custom subject"
      }
  }
  </code></pre>
  
  <p>Upd2 (JS trigger):</p>
  
  <p>I added code on js (new trigger for custom email) based on <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-lambda-trigger-examples.html#aws-lambda-triggers-custom-message-example" rel="nofollow noreferrer">example</a> and that works for custom email when user wants confirmation code, but that doesn't work for confirmation link. Again, I tried {##link##} for the link.</p>