{"action":"opened","issue":{"url":"https://api.github.com/repos/alphagov/specialist-publisher-rebuild/issues/524","repository_url":"https://api.github.com/repos/alphagov/specialist-publisher-rebuild","labels_url":"https://api.github.com/repos/alphagov/specialist-publisher-rebuild/issues/524/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/specialist-publisher-rebuild/issues/524/comments","events_url":"https://api.github.com/repos/alphagov/specialist-publisher-rebuild/issues/524/events","html_url":"https://github.com/alphagov/specialist-publisher-rebuild/issues/524","id":147102103,"number":524,"title":"[CLOSED] Send correct format for ESIF documents to email-alert-api","user":{"login":"benilovj","id":23801,"avatar_url":"https://avatars.githubusercontent.com/u/23801?v=3","gravatar_id":"","url":"https://api.github.com/users/benilovj","html_url":"https://github.com/benilovj","followers_url":"https://api.github.com/users/benilovj/followers","following_url":"https://api.github.com/users/benilovj/following{/other_user}","gists_url":"https://api.github.com/users/benilovj/gists{/gist_id}","starred_url":"https://api.github.com/users/benilovj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benilovj/subscriptions","organizations_url":"https://api.github.com/users/benilovj/orgs","repos_url":"https://api.github.com/users/benilovj/repos","events_url":"https://api.github.com/users/benilovj/events{/privacy}","received_events_url":"https://api.github.com/users/benilovj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-09T07:31:00Z","updated_at":"2016-04-09T07:31:00Z","closed_at":null,"body":"<a href=\"https://github.com/jamiecobbett\"><img src=\"https://avatars.githubusercontent.com/u/93739?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [jamiecobbett](https://github.com/jamiecobbett)**\n_Friday 24 July 2015 at 09:59 GMT_\n_Originally opened as https://github.com/alphagov/specialist-publisher/pull/524_\n\n----\n\nWe were sending \"esi_fund\" to email-alert-api because that's the string used as\r\nthe \"document_type\" internal to specialist-publisher. All of the other\r\nexporters, however, use \"european_structural_investment_fund\". This means that\r\nemail subscriptions are created for the format\r\n\"european_structural_investment_fund\", but email alerts are triggered for\r\n\"esi_fund\", therefore, there aren't any matching subscriptions and so emails\r\nweren't sent.\r\n\r\nI couldn't see where and how to write a test for this, suggestions welcome.\n\n----\n\n_**[jamiecobbett](https://github.com/jamiecobbett)** included the following code: https://github.com/alphagov/specialist-publisher/pull/524/commits_\n"}}