{"action":"opened","issue":{"url":"https://api.github.com/repos/mautic/mautic/issues/1745","repository_url":"https://api.github.com/repos/mautic/mautic","labels_url":"https://api.github.com/repos/mautic/mautic/issues/1745/labels{/name}","comments_url":"https://api.github.com/repos/mautic/mautic/issues/1745/comments","events_url":"https://api.github.com/repos/mautic/mautic/issues/1745/events","html_url":"https://github.com/mautic/mautic/issues/1745","id":154939175,"number":1745,"title":"Feature request: dynamic content in emails based on variables","user":{"login":"cspenn","id":6747905,"avatar_url":"https://avatars.githubusercontent.com/u/6747905?v=3","gravatar_id":"","url":"https://api.github.com/users/cspenn","html_url":"https://github.com/cspenn","followers_url":"https://api.github.com/users/cspenn/followers","following_url":"https://api.github.com/users/cspenn/following{/other_user}","gists_url":"https://api.github.com/users/cspenn/gists{/gist_id}","starred_url":"https://api.github.com/users/cspenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cspenn/subscriptions","organizations_url":"https://api.github.com/users/cspenn/orgs","repos_url":"https://api.github.com/users/cspenn/repos","events_url":"https://api.github.com/users/cspenn/events{/privacy}","received_events_url":"https://api.github.com/users/cspenn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-15T23:42:46Z","updated_at":"2016-05-15T23:42:46Z","closed_at":null,"body":"# Idea\r\n\r\nControl email output with conditional variables.\r\n\r\n## Description\r\n\r\nPHP or variable based dynamic content based on user data. For example, suppose you had an email with this basic content:\r\n\r\n- Intro\r\n- Story\r\n- Offer\r\n- Conclusion\r\n\r\nBut suppose you know who your best customers are. Maybe you have their name, or their title. What if we could have the email above and then a block of code in the email?\r\n\r\n- Intro\r\n\r\n(if score > 50 AND firstname IS NOT NULL and lastname IS NOT NULL and title like '%CEO%'){\r\n- SPECIAL OFFER!\r\n}\r\n\r\n- Story\r\n- Offer\r\n- Conclusion\r\n\r\nAt runtime, one email would be sent, but rendered differently based on database fields."}}