• Hello,

    I need to change the text heading in confirmation email receipt sent to donors. I just want it to say ‘Receipt’ instead of ‘Donation Receipt.

    I’ve been able to change other fields as needed in the plugin settings, but not the big main email header.

    Could you please advise where / how I can change this wording?

    Thank you so much!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Matt Cromwell

    (@webdevmattcrom)

    HI there,

    Hmmm… it looks like it SHOULD be editable from the Donation Subject field, but isn’t. We’ll have to look into that.

    For now you can change it with this custom snippet:

    function my_give_text_switcher( $translations, $text, $domain ) {
    	
    	if ( $domain == 'give' && $text == 'Donation Receipt' ) {
    		$translations = __( 'Receipt', 'give' );
    	}
    
    	return $translations;
    }
    add_filter( 'gettext', 'my_give_text_switcher', 10, 3 );

    If you need guidance implementing custom PHP functions on your website, we have this guide here: https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/

    Thanks!

    Thread Starter laurenandchris

    (@laurenandchris)

    When I tried to paste this in it comes up saying: Sorry, but your code causes a “Fatal error”, so it is not applied! Please, check the code and try again.

    Is there another code I could please try?

    Thank you!

    Plugin Contributor Devin Walker

    (@dlocc)

    Hey @laurenandchris – I just checked the code and did not see any errors. Are you sure everything was copy and pasted properly? 🙂

    Thread Starter laurenandchris

    (@laurenandchris)

    I copied the code exactly and added it to my custom functions PHP code…
    It said the same message, that there was a fatal error and code couldn’t be applied. This is a cut and paste of exactly what I copied… is there something wrong? What else could I please try? Is there some where else I need to cut and paste it into? I really appreciate your help!

    function my_give_text_switcher( $translations, $text, $domain ) {

    if ( $domain == ‘give’ && $text == ‘Donation Receipt’ ) {
    $translations = __( ‘Receipt’, ‘give’ );
    }

    return $translations;
    }
    add_filter( ‘gettext’, ‘my_give_text_switcher’, 10, 3 );

    Plugin Contributor Devin Walker

    (@dlocc)

    Honestly it looks good to me. Is there another function that is causing the fatal error higher up? I’m not seeing any syntax errors which would cause it in this function.

    Plugin Contributor Matt Cromwell

    (@webdevmattcrom)

    Hi @laurenandchris just following up, we’d love to get this working for you. Let us know what we can do.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Change Email Receipt Text’ is closed to new replies.