SendGrid-Python.

SendGrid Python ¶óÀ̺귯¸®
Áö±Ý ´Ù¿î·Îµå

SendGrid-Python. ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • MIT/X Consortium Lic...
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Kane Kim
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • https://github.com/sendgrid/

SendGrid-Python. ű×


SendGrid-Python. ¼³¸í

SendGrid-PythonÀº Python.Installusing GitHub¸¦ »ç¿ëÇÏ¿© SendGrid¸¦ ÅëÇØ ½±°í ºü¸£°Ô ÀüÀÚ ¸ÞÀÏÀ» º¸³»½Ç ¼öÀÖ´Â ÆÄÀ̽㠶óÀ̺귯¸®ÀÔ´Ï´Ù. Git Clone git@github.com : sendGrid / sendGrid-Python.Gitusing Pypi : Easy_install SendGrid-PythonSendGrid ApisSendGrid´Â µÎ °¡Áö ¹æ¹ýÀ» Á¦°øÇÕ´Ï´Ù. ÀüÀÚ ¸ÞÀÏ º¸³»±â : Web API ¹× SMTP API. SendGrid´Â ÀüÀÚ ¸ÞÀÏÀ» º¸³»´Â SMTP API¸¦ »ç¿ëÇÏ´Â °ÍÀÌ ÁÁ½À´Ï´Ù. °¢°¢ÀÇ ÀÌÁ¡¿¡ ´ëÇÑ ¼³¸íÀº http://docs.sendgrid.com/documentation/get-started/integrate/examples/smtp-vs-rest/smtp-vs-rest/¸¦ ÂüÁ¶ÇϽʽÿÀ.ÀÌ ¶óÀ̺귯¸®´Â ¸Å¿ì ½±°Ô ¸¸µé ¼öÀÖ´Â °øÅë ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÕ´Ï´Ù. API.MAIL Pre-Usage¸¦ »ç¿ëÇϱâ Àü¿¡ ¶óÀ̺귯¸®¸¦ »ç¿ëÇϱ⠽ÃÀÛÇÕ´Ï´Ù. ¶óÀ̺귯¸® ¾ÆÅ°ÅØó¿¡ ´ëÇÑ ¸î °¡Áö »çÇ×À» ÀÌÇØÇÏ´Â °ÍÀÌ Áß¿äÇÕ´Ï´Ù. À̸ÞÀÏÀ» º¸³»´Â °Í¸¸ Å­ °£´ÜÇÕ´Ï´Ù. 1. sendGrid instance2 ¸¸µé±â. SendGrid Mail °³Ã¼¸¦ ¸¸µé°í Data3À» ¼³Á¤ÇÕ´Ï´Ù. SMTP API ¶Ç´Â WEB API.MAIL USAGEIMPORT SENDGRIDS = SENDGRIDSENDGRIDS ( '»ç¿ëÀÚ À̸§', '¾ÏÈ£', SECURE = TRUE)¸¦ »ç¿ëÇÏ¿© ¸ÞÀÏÀ» º¸³»´Â ¸Þ½ÃÁö = sendGrid.Message ( "from@mydomain.com", "Á¦¸ñ", " ÀÏ¹Ý º»¹® "," html here ") message.add_to ("someone@example.com ","john doe ") s.web.send (¸Þ½ÃÁö) ors.smtp.send (¸Þ½ÃÁö)¸¦ »ç¿ëÇÏ¿© Ä«Å×°í¸® Ä«Å×°í¸®´Â SendGrid¿¡¼­ Á¦°øÇÏ´Â ÀüÀÚ ¸ÞÀÏ Åë°è¸¦ ±×·ìÈ­ÇÏ´Â µ¥ »ç¿ëµË´Ï´Ù. Ä«Å×°í¸®¸¦ »ç¿ëÇÏ·Á¸é ¹üÁÖ À̸§À» ¼³Á¤ÇϽʽÿÀ. Âü°í : À̸ÞÀÏ ´ç ÃÖ´ë 10 °³ÀÇ ¹üÁÖ°¡ ÀÖ½À´Ï´Ù. SendGrid.Message ( "from@mydomain.com", "Á¦¸ñ", "ÀÏ¹Ý º»¹®", ¿©±â ") message.add_category () attachmentsfile ÷ºÎ ÆÄÀÏÀ» »ç¿ëÇÏ¿© file.message = sendGrid.Message ( "from@mydomain.com", "subject", "plain body", " HTML ¿©±â ") message.add_attachment ("file1.doc ","/ path/to/file.doc").add_attachment("file2.nfo ","ÆÄÀÏ 2 "ÆÄÀÏ 2"ÆÄÀÏ 2 "ÆÄÀÏ 2") ¸ÖƼ ¼ö½ÅÀÚ ÀüÀÚ ¸ÞÀÏÀ» »ç¿ëÀÚ Á¤ÀÇÇÏ°í usermessage = sendGrid.Message ( "from@mydomain.com", "Á¦¸ñ", "hello % À̸§ À̸§ %, ÄÚµå´Â % ÄÚµå"% "," hello % À̸§ %, ÄÚµå´Â % ÄÚµå % ") message.add_to ({ 'example1@example.com': { '% À̸§ %': 'À̸§ 1', '% ÄÚµå %': 'ÄÚµå 1' }, 'example2@example.com': { '% À̸§ %': 'name 2', '% ÄÚµå %': 'ÄÚµå 2'},}) ¼½¼ÇÀ» »ç¿ëÇÏ¿© ÃÖÁ¾ »ç¿ëÀÚÀÇ ¸Þ½ÃÁö¸¦ ´õ »ç¿ëÀÚ Á¤ÀÇÇÏ´Â µ¥ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼½¼ÇÀº Á¶Àý±â °ª°ú ÇÔ²² À¯¿ëÇÕ´Ï´Ù. SendGrid.message ( "from@mydomain.com", "Á¦¸ñ", "hello % À̸§ À̸§ %,"% place % "," hello % À̸§ %, % ") message.add_to ({ 'example1@example.com': { '% name %': 'À̸§ 1', '% Place %': '% Ȩ % '},'example2@example.com ': {'% À̸§ % ':'À̸§ 2 ','% place % ':'% Office % '},}). set_sections ({ "% Office %": " Office ","% home % ":"home "}) °íÀ¯ ÇÑ ArgumentSunique Àμö¸¦ »ç¿ëÇÏ¿© purposesmessage = sendGrid.Message ("from@mydomain.com ","subject ","plain body "," " HTML ") message.add_unique_argument ("°í°´ ","´©±º°¡ ") ÇÊÅÍ ¼³Á¤À» »ç¿ëÇÏ¿© ¾ÛÀ» È°¼ºÈ­ ¹× ºñÈ°¼ºÈ­ÇÏ°í ÇØ´ç ¾Û¿¡ ¸Å°³ º¯¼ö¸¦ Àü´ÞÇÏ´Â µ¥ »ç¿ëµË´Ï´Ù .message = sendGrid.Message ("@ mydomain¿¡¼­ " .com ","ÁÖÁ¦ ","ÀÏ¹Ý º»¹® ", ¿©±â¼­" html ¿©±â ") message.add_filter_setting ("¹Ù´Ú ±Û ","ÅؽºÆ® / ÀÏ¹Ý ","ÀÏ¹Ý ÅؽºÆ® ¹Ù´Ú ±Û ") ¸Þ½ÃÁö°¡ ÀÖ½À´Ï´Ù. add_filter_setting ( "¹Ù´Ú ±Û", "text / html", "