Forum Discussion

Jonathan_Hart's avatar
4 years ago

Invalid Email due to Ampersand

Trying to add an email address to an escalation chain. the email in question has an Ampersand (&) symbol in it and when trying to add it, it errors saying "invalid email".

Is there a way around this that anybody is aware of?

Thanks
Jonny

  • Anonymous's avatar
    Anonymous

    Looks like the syntax checker is local in your browser, so there'd need to be a feature request to get that fixed. Reach out to your CSM to make sure that gets done.

    I was able to add "new&ampersand@example.com" to one of my escalation chains through v2 of the API. I mimicked what the UI does by observing it in chrome as i put in "new@example.com". It did a PUT to /setting/alert/chains/3, where 3 is the ID of the escalation chain I added to. PUT operations require the entire payload of what you want the finished object to look like, so i grabbed the payload from chrome's developer tools, updated the email address and did a PUT a href="https://communities.logicmonitor.com/topic/1964-accessing-the-logicmonitor-rest-api-with-postman-and-lmv1-api-token-authentication/#comment-4808" rel="">through postman. This is what my payload looked like:

    {
      "ccDestinations": [
      ],
      "description": "",
      "destinations": [
        {
          "stages": [
            [{"addr": "victoria","contact": "","method": "email","type": "ADMIN"}],
            [{"addr": "On Call","contact": "","method": "","type": "GROUP"}],
            [{"addr": "new&ampersand@example.com","method": "email","type": "ARBITRARY"}]
          ],
          "type": "single"
        }
      ],
      "enableThrottling": true,
      "id": 3,
      "inAlerting": false,
      "lnkUseTimeBasedHelp": false,
      "name": "Network Operations",
      "throttlingAlerts": "20",
      "throttlingPeriod": "10"
    }