Project

General

Profile

« Previous | Next » 

Revision 54444

Added by Sofia Baltzi over 5 years ago

Add format Email body to invite users functionality

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/email/composer.ts
1 1
import {Email} from "./email";
2
import {Body} from "./body";
2 3

  
3 4
export class Composer {
4 5
  private static noteBodySize = "14px";
......
6 7

  
7 8
  // TODO move to properties
8 9
  private static openaireEmail = "mailto:openaire.test@gmail.com";
9
  private static signature =  "OpenAIRE team<br>" + "<a href='https://www.openaire.eu'>www.openaire.eu</a><br>";
10
  private static openaireAddress = "<a href='https://www.openaire.eu'>www.openaire.eu</a><br>";
11
  private static signature =  "OpenAIRE team<br>" + Composer.openaireAddress;
10 12

  
11 13
  private static ifYouAreNotResponsible(): string {
12 14
      return "If you are not responsible for this community, please "
......
83 85

  
84 86
    return email;
85 87
  }
86
  
88

  
89
  public static formatEmailBodyForInvitation(body: Body): string {
90
    let fromMessageAndName = "";
91

  
92
    if (body.fromName != "") {
93
      fromMessageAndName = "<span>" + body.fromMessage + body.fromName + "</span>";
94
    }
95

  
96
    let formattedEmail = "<div style='font-size:" + this.noteBodySize + "'>"
97
                         + body.paragraphs
98
                         + "<p>" + body.signature + fromMessageAndName + "<br>"
99
                         + this.openaireAddress
100
                         + "</p>"
101
                         + "</div>";
102

  
103
    return formattedEmail;
104
  }
105

  
87 106
}

Also available in: Unified diff