Skip to content

PHP library which converts an email subject line into reply style

License

Notifications You must be signed in to change notification settings

osanay/email-subject-replyifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Subject Replyifier

Convert an email subject line into reply style, inspired by Perl’s Mail::Message::Construct::Reply.

Usage

The replyify() method creates a subject for a message which is a reply to this one:

<?php

use Osanay\EmailSubjectReplyifier\Replyifier;

$subject = Replyifier::replyify('subject');                 // Re: subject
$subject = Replyifier::replyify('Re: subject');             // Re: subject
$subject = Replyifier::replyify('Re[2]: subject');          // Re: subject
$subject = Replyifier::replyify('Re: Re: Re: Re: subject'); // Re: subject

Adding Re: count

If you need a Re: count in an email subject line, you can pass true as the second argument:

$subject = Replyifier::replyify('subject', true);                 // Re: subject
$subject = Replyifier::replyify('Re: subject', true);             // Re[2]: subject
$subject = Replyifier::replyify('Re[2]: subject', true);          // Re[3]: subject
$subject = Replyifier::replyify('Re: Re: Re: Re: subject', true); // Re[5]: subject

This routine tries to count the level of reply in the subject field, and transform it into a standard form.

About

PHP library which converts an email subject line into reply style

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages