{"action":"created","issue":{"url":"https://api.github.com/repos/statamic/v2-hub/issues/1988","repository_url":"https://api.github.com/repos/statamic/v2-hub","labels_url":"https://api.github.com/repos/statamic/v2-hub/issues/1988/labels{/name}","comments_url":"https://api.github.com/repos/statamic/v2-hub/issues/1988/comments","events_url":"https://api.github.com/repos/statamic/v2-hub/issues/1988/events","html_url":"https://github.com/statamic/v2-hub/issues/1988","id":328171083,"node_id":"MDU6SXNzdWUzMjgxNzEwODM=","number":1988,"title":"New conditionals: is_email and is_url","user":{"login":"chris-79","id":1659383,"node_id":"MDQ6VXNlcjE2NTkzODM=","avatar_url":"https://avatars0.githubusercontent.com/u/1659383?v=4","gravatar_id":"","url":"https://api.github.com/users/chris-79","html_url":"https://github.com/chris-79","followers_url":"https://api.github.com/users/chris-79/followers","following_url":"https://api.github.com/users/chris-79/following{/other_user}","gists_url":"https://api.github.com/users/chris-79/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-79/subscriptions","organizations_url":"https://api.github.com/users/chris-79/orgs","repos_url":"https://api.github.com/users/chris-79/repos","events_url":"https://api.github.com/users/chris-79/events{/privacy}","received_events_url":"https://api.github.com/users/chris-79/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T14:49:58Z","updated_at":"2018-05-31T15:01:38Z","closed_at":null,"author_association":"NONE","body":"**Is your feature request related to a problem? Please describe.**\r\nIt's pretty annoying to always create a new regex to determine if a string is an email address or is a URL. The Macros feature doesn't offer this as a shortcut, either\r\n\r\n**Describe the solution you'd like**\r\nIt'd be _sUpEr AwEsOmE_ if the conditionals `is_email` and `is_url` would be able to do the job\r\n\r\n**Describe alternatives you've considered**\r\nTried using Macros, to no avail\r\n\r\n**Additional context**\r\nReference for Email regex:  [emailregex.com](https://emailregex.com)\r\n\r\nExample usage in a template:\r\n\r\n```handlebars\r\n{{ if (registration_method | is_email) }}\r\n  <a href=\"mailto:{{ registration_method }}\">\r\n    Register via Email\r\n  </a>\r\n{{ elseif (registration_method | is_url) }}\r\n  <a href=\"{{ registration_method }}\">\r\n    Open Registration Form\r\n  </a>\r\n{{ /if }}\r\n```\r\n\r\n**Would you be willing to sponsor this feature?**\r\nCouldn't do it from my personal budget\r\n"},"comment":{"url":"https://api.github.com/repos/statamic/v2-hub/issues/comments/393559978","html_url":"https://github.com/statamic/v2-hub/issues/1988#issuecomment-393559978","issue_url":"https://api.github.com/repos/statamic/v2-hub/issues/1988","id":393559978,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzU1OTk3OA==","user":{"login":"jasonvarga","id":105211,"node_id":"MDQ6VXNlcjEwNTIxMQ==","avatar_url":"https://avatars1.githubusercontent.com/u/105211?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonvarga","html_url":"https://github.com/jasonvarga","followers_url":"https://api.github.com/users/jasonvarga/followers","following_url":"https://api.github.com/users/jasonvarga/following{/other_user}","gists_url":"https://api.github.com/users/jasonvarga/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonvarga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonvarga/subscriptions","organizations_url":"https://api.github.com/users/jasonvarga/orgs","repos_url":"https://api.github.com/users/jasonvarga/repos","events_url":"https://api.github.com/users/jasonvarga/events{/privacy}","received_events_url":"https://api.github.com/users/jasonvarga/received_events","type":"User","site_admin":false},"created_at":"2018-05-31T15:01:38Z","updated_at":"2018-05-31T15:01:38Z","author_association":"MEMBER","body":"`php please make:modifiers-helper` and add these:\r\n\r\n```\r\n    public function isEmail($value)\r\n    {\r\n        return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;\r\n    }\r\n\r\n    public function isUrl($value)\r\n    {\r\n        return filter_var($value, FILTER_VALIDATE_URL) !== false;\r\n    }\r\n```\r\n\r\nHowever, they're so simple I've added them to the next release anyway."}}
{"actor":{"display_login":"jasonvarga"}}