Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Mailparse to parse rfc822 email address efficiently. #594

Closed
wants to merge 315 commits into from

Conversation

ssiddhantsharma
Copy link
Contributor

@ssiddhantsharma ssiddhantsharma commented Apr 2, 2018

We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.

Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
e.g.
Fixes #497

Fixes

Checklist

  • [*] I have made a material change to the repo (functionality, testing, spelling, grammar)
  • [*] I have read the [Contribution Guide] and my PR follows them.
  • [*] I updated my branch with the master branch.
  • [*] I have added tests that prove my fix is effective or that my feature works
  • [*] I have added necessary documentation about the functionality in the appropriate .md file
  • [*] I have added in line documentation to the code I modified

Short description of what this PR does:

  • Adding a mail parse function to parse rfc822 email addresses.
  • Parses the given email string and return a structured address.

Sample Code (Tested on local machine) -
`<?php
// input: My Email some.test.email@somewhere.net

function get_name_from_rfc_email($rfc_email_string) {
// match all words and whitespace will be terminated by '<'
$name = preg_match('/[\w\s]+/', $rfc_email_string, $match);
$match[0] = trim($match[0]);
return $match[0];
}
// Output: My Email

function get_email_from_rfc_email($rfc_email_string) {
// extract parts between ( )
$EmailAddress = preg_match('/(?:&lt;)(.+)(?:&gt;)$/', $rfc_email_string, $match);
return $match[1];
}
// Output: some.test.email@somewhere.net
?>`

thinkingserious and others added 30 commits May 4, 2017 23:31
Avoids:
```
PHP Notice:  Array to string conversion
```
Use `print_r` instead of `echo` on Arrays.
…ithout-composer

Updating docs and non-composer includes
resolves issue 399 containing list_id within payload of /contactdb/li…
…them as required. This is based on Elmer's comments on PR #408
Optional mail constructor arguments now set those available
…ch parameters are required for sending all email
There was no way for the sections to get substituted without there being a substitution that calls them. This updated example fixes that.
thinkingserious and others added 25 commits March 23, 2018 20:02
Added Code Review to Contributing.md
Add Code Review to Contributing.md
Omit PHP closing tag in use case sample
Add support for commas and semicolons in email name and add test
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Apr 2, 2018
@SendGridDX
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
47 out of 60 committers have signed the CLA.

✅ thinkingserious
✅ rparpa
✅ qligier
✅ ssiddhantsharma
✅ manfordbenjamin
✅ emirb
✅ saruman
✅ mbernier
✅ tomhorvat
✅ samundra
✅ yeoji
✅ pangaunn
✅ anatolyyyyyy
✅ kraigh
✅ gabidavila
✅ mptap
✅ ciceropablo
✅ uppe-r
✅ pxgamer
✅ caseyw
✅ Braunson
✅ bertuss
✅ ankitjain28may
✅ thepriefy
✅ pushkyn
✅ runz0rd
✅ prashuchaudhary
✅ myzeprog
✅ nalinbhardwaj
✅ tarlepp
✅ brandon93s
✅ valerianpereira
✅ AlbinoDrought
✅ dereckson
✅ Rubemlrm
✅ lalitvj
✅ amsourav
✅ gabrielkrell
✅ joeldixon66
✅ kenske
✅ ladhadha
✅ shra1cumar
✅ mrmxs
✅ ryanpcmcquen
✅ jopanel
✅ kylearoberts
✅ naughtLdy
❌ SendGridDX
❌ cbschuld
❌ paoga87
❌ tarcisiozf
❌ ninsuo
❌ Taluu
❌ Dreyer
❌ sendgrid-gists
❌ MikeRalphson
❌ michaeljdennis
❌ aautar
❌ akeeman
❌ Arjan Keeman


Arjan Keeman seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ssiddhantsharma ssiddhantsharma changed the base branch from mail to inbound April 2, 2018 15:06
@thinkingserious
Copy link
Contributor

Hello @ssiddhantsharma,

It looks like something went wrong with this PR. Could you please create a new fork, add your changes and submit a new PR? Thanks!

With Best Regards,

Elmer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet