Sendgrid-nodejs: 주어진 μ˜ˆμ—μ„œ λŒ€μ²΄κ°€ μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

에 λ§Œλ“  2018λ…„ 07μ›” 25일  Β·  4μ½”λ©˜νŠΈ  Β·  좜처: sendgrid/sendgrid-nodejs

μž¬ν˜„ 단계

이것은 이메일을 λ³΄λƒ…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ μ–΄λ–€ λŒ€μ²΄λ„ ν…œν”Œλ¦Ώμ„ λŒ€μ²΄ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. νŠΈλžœμž­μ…˜ ν…œν”Œλ¦Ώ μ„Ήμ…˜μ—μ„œ μ–ΈκΈ‰ ν•œ 두 가지 예제λ₯Ό λͺ¨λ‘ λ”°λžκ³  이것도 μ‹œλ„ν–ˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ HTML ν…œν”Œλ¦Ώμ˜ λ³€μˆ˜λ₯Ό μ •μ˜ 된 λŒ€μ²΄λ‘œ λŒ€μ²΄ν•˜λŠ” 것은 μ—†μŠ΅λ‹ˆλ‹€.

이것은 λ‚΄ ν…œν”Œλ¦Ώμž…λ‹ˆλ‹€

<html>
<head>
    <title></title>
</head>
<body>
Hello {{name}},
<br /><br/>
I'm glad you are trying out the template feature!
<br /><br/>
<%body%>
<br /><br/>
I hope you are having a great day in {{city}} :)
<br /><br/>
</body>
</html>

헀더λ₯Ό <%subject%>

그리고 이것은 λ‚΄ μ½”λ“œμž…λ‹ˆλ‹€.

 sgMail.setSubstitutionWrappers('{{', '}}'); // Configure the substitution tag wrappers globally
    const msg = {
    to: '[email protected]',
    from: '[email protected]',
    subject: 'Hello world',
    text: 'Hello plain world!',
    html: '<p>Hello HTML world!</p>',
    templateId: 'd-5d04c39e40054d118b4de3fba82a09ac',
    substitutions: {
        name: "Some One",
        city: "Denver"
    },
    };
    sgMail.send(msg);

이것은 이메일을 보내지 만 λ‹€μŒκ³Ό 같이 μˆ˜μ‹ ν•©λ‹ˆλ‹€.

Hello , 

I'm glad you are trying out the template feature! 

<%body%> 

I hope you are having a great day in :) 

μ£Όμ œλŠ” <%subject%> μž…λ‹ˆλ‹€.

λ³΄κ³ λ˜λŠ” λ¬Έμ œμ™€ κ΄€λ ¨ν•˜μ—¬ κ³΅μœ ν•˜λ €λŠ” 기타 정보. 특히 이것이 버그라고 μƒκ°ν•˜λŠ” μ΄μœ λŠ” λ¬΄μ—‡μž…λ‹ˆκΉŒ? λŒ€μ‹  μ–΄λ–€ 일이 일어날 κ²ƒμœΌλ‘œ μ˜ˆμƒν•©λ‹ˆκΉŒ?

λ‚˜λŠ” 이와 같은 이메일을 κΈ°λŒ€ν•˜κ³  μžˆμ—ˆλ‹€ (제λͺ©μ€ Hello world )

Hello Some One, 

I'm glad you are trying out the template feature! 

I hope you are having a great day in Denver :) 

ν…ŒμŠ€νŠΈ λ°μ΄ν„°λ‘œ ν…œν”Œλ¦Ώ μ—”μ§„μ—μ„œ ν…ŒμŠ€νŠΈλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

{
  "name": "Some One",
    "city": "Denver"
}

이것은 ν…œν”Œλ¦Ώ 엔진에 μ˜¬λ°”λ₯΄κ²Œ ν‘œμ‹œλ©λ‹ˆλ‹€.

unknown or a help wanted question

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

@ pankaja92 λ₯Ό 도와 μ£Όμ…”μ„œ κ°μ‚¬ν•˜κ³  @ bbbneo333 μ—κ²Œ κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€!

λ¬Έμ œλŠ” μƒˆ 동적 ν…œν”Œλ¦Ώμ„ μ‚¬μš©ν•˜λŠ” 경우 API 호좜이 μ•½κ°„ λ‹€λ₯΄λ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€. μ΄λŸ¬ν•œ λ³€κ²½ 사항을 λ°˜μ˜ν•˜κΈ° μœ„ν•΄ 곧이 SDK의 μ„€λͺ…μ„œλ₯Ό μ—…λ°μ΄νŠΈ ν•  μ˜ˆμ •μž…λ‹ˆλ‹€.

λͺ¨λ“  4 λŒ“κΈ€

λ‚˜λŠ” 같은 λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆλ‹€. λ₯Ό 톡해 메일을 λ§Œλ“€ λ•Œ Mail.create μ—μ„œ @sendmail/helpers , λ‚˜λŠ”κ΅°μš” mail.substitutions = null

@ bbbneo333 이 λ¬Έμ œμ— 제곡된 λ§ˆμ§€λ§‰ μ†”λ£¨μ…˜μ„ ν™•μΈν•˜μ‹­μ‹œμ˜€. 그것은 λ‚˜λ₯Ό μœ„ν•΄ μΌν–ˆμŠ΅λ‹ˆλ‹€

예. substitutions λ₯Ό personalizations.0.dynamic_template_data λ°”κΎΈλ©΄ νš¨κ³Όκ°€μžˆμ—ˆμŠ΅λ‹ˆλ‹€. 감사.

@ pankaja92 λ₯Ό 도와 μ£Όμ…”μ„œ κ°μ‚¬ν•˜κ³  @ bbbneo333 μ—κ²Œ κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€!

λ¬Έμ œλŠ” μƒˆ 동적 ν…œν”Œλ¦Ώμ„ μ‚¬μš©ν•˜λŠ” 경우 API 호좜이 μ•½κ°„ λ‹€λ₯΄λ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€. μ΄λŸ¬ν•œ λ³€κ²½ 사항을 λ°˜μ˜ν•˜κΈ° μœ„ν•΄ 곧이 SDK의 μ„€λͺ…μ„œλ₯Ό μ—…λ°μ΄νŠΈ ν•  μ˜ˆμ •μž…λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰

κ΄€λ ¨ 문제

danielflippance picture danielflippance  Β·  4μ½”λ©˜νŠΈ

TobiahRex picture TobiahRex  Β·  3μ½”λ©˜νŠΈ

egges picture egges  Β·  3μ½”λ©˜νŠΈ

thinkingserious picture thinkingserious  Β·  4μ½”λ©˜νŠΈ

amlcodes picture amlcodes  Β·  4μ½”λ©˜νŠΈ