message: add getEmailInfoForProject to commons
diff: @@ -645,6 +645,34 @@ async function getSlackinfoForProject(project: string): Promise<Project> {
  return result.project.slacks;
  }
  +async function getEmailInfoForProject(
  + project: string,
  +): Promise<Array<Object>> {
  + const notificationsFragment = graphqlapi.createFragment(`
  + fragment on NotificationEmail {
  + emailAddress
  + }
  + `);
  +
  + const result = await graphqlapi.query(`
  + {
  + project:projectByName(name: "${project}") {
  + emails: notifications(type: EMAIL) {
  + ...${notificationsFragment}
  + }
  + }
  + }
  + `);
  +
  + if (!result || !result.project || !result.project.emails) {
  + throw new ProjectNotFound(
  + `Cannot find email information for project ${project}`,
  + );
  + }
  +
  + return result.project.emails;
  +}
  +
  async function getActiveSystemForProject(
  project: string,
  task: string,
  @@ -1030,6 +1058,7 @@ module.exports = {
  getProjectByName,
  getRocketChatInfoForProject,
  getSlackinfoForProject,
  + getEmailInfoForProject,
  getActiveSystemForProject,
  getOpenShiftInfoForProject,
  getEnvironmentByName,
  