Categorygithub.com/dimiro1/reply
modulepackage
0.0.0-20200315094148-d0136a4c9e21
Repository: https://github.com/dimiro1/reply.git
Documentation: pkg.go.dev

# README

go.dev reference Build Status Go Report Card

Try browsing the code on Sourcegraph!

reply

Library to trim replies from plain text email. (Golang port of https://github.com/discourse/email_reply_trimmer)

Usage

package main

import (
    "fmt"

    "github.com/dimiro1/reply"
)

func main() {
    message := `
        This is before the embedded email.
        
        On Wed, Sep 25, 2013, at 03:57 PM, richard_clark wrote:
        
        Richard> This is the embedded email
        
        This is after the embedded email and will not show up because 99% of the times
        this is the signature...
    `
	fmt.Println(reply.FromText(message))
}

will output:

This is before the embedded email.

# Functions

FromReader returns the reply text from the e-mail text body.
FromText returns the reply text from the e-mail text body.