Skip to content

Commit

Permalink
[#832] Tweaks to email copy and URL fixes (#833)
Browse files Browse the repository at this point in the history
* [#832] add bids to auction summary intro

* [#832] update auction summary admin conclusion

* [#832] auction summary admin plain text updates

* [#832] remove extra period

* [#832] remove extra period

* [#832] add bid to subject line

* [#832] Add free bid to subject line

* [#832] add free bid url

* [#832] update auction free bid earned

* Update auction-free-bid-earned.php

* [n/a] removing duplicate free-bid email - Updating free_bids_url

---------

Co-authored-by: Nathan Schmidt <[email protected]>
  • Loading branch information
clatwell and nathan-schmidt-viget authored Mar 26, 2024
1 parent 4b53ce7 commit a48c7db
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 200 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function ( int $order_id ) {
public function get_default_subject(): string {
return sprintf(
/* translators: %1$s: site title, %2$s: auction title */
__( '[%1$s] %2$s Confirmation', 'goodbids' ),
__( '[%1$s] %2$s Free Bid Confirmation', 'goodbids' ),
'{site_title}',
'{auction.title}'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function ( int $order_id ) {
public function get_default_subject(): string {
return sprintf(
/* translators: %1$s: site title, %2$s: auction title */
__( '[%1$s] %2$s Confirmation', 'goodbids' ),
__( '[%1$s] %2$s Bid Confirmation', 'goodbids' ),
'{site_title}',
'{auction.title}'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function has_initialized(): bool {
*/
private function add_button_support(): void {
/* translators: %s: list of placeholders */
$placeholder_text = sprintf( __( 'Available placeholders: %s', 'goodbids' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );
$placeholder_text = sprintf( __( 'Available placeholders: %s', 'goodbids' ), '<code>' . esc_html( implode( '</code>, <code>', array_keys( $this->placeholders ) ) ) . '</code>' );

// Custom Fields
$this->set_form_field(
Expand Down Expand Up @@ -239,6 +239,7 @@ public function get_default_button_text(): string {
public function get_button_text(): string {
/**
* Filter the button text.
*
* @since 1.0.0
*
* @param string $button_text The button text.
Expand Down Expand Up @@ -481,6 +482,7 @@ private function default_placeholders(): void {
$this->add_placeholder( '{user.name}', $this->get_user_name() );
$this->add_placeholder( '{user.account_url}', wc_get_page_permalink( 'myaccount' ) );
$this->add_placeholder( '{user.free_bid_count}', goodbids()->free_bids->get_available_count( $this->user_id ) );
$this->add_placeholder( '{user.free_bids_url}', goodbids()->free_bids->get_free_bids_url( $this->user_id ) );
$this->add_placeholder( '{user.referral_link}', $referrer->get_link() );

// Order Details
Expand Down Expand Up @@ -684,7 +686,7 @@ protected function get_email_vars(): array {
* @since 1.0.0
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return void
*/
Expand Down Expand Up @@ -734,6 +736,7 @@ public function get_content_plain(): string {

/**
* Add or change a form field.
*
* @since 1.0.0
*
* @param string $key
Expand Down Expand Up @@ -893,7 +896,12 @@ public function send_to_bidders( Auction $auction ): void {
* @return void
*/
public function send_to_admins( mixed $object ): void {
$admins = get_users( [ 'role' => 'administrator', 'fields' => 'ID' ] );
$admins = get_users(
[
'role' => 'administrator',
'fields' => 'ID',
]
);

if ( $this->is_super_admins_email() ) {
$super_admins = get_super_admins();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace GoodBids\Plugins\WooCommerce\Emails;

use GoodBids\Plugins\WooCommerce\Account;
use GoodBids\Users\FreeBid;

defined( 'ABSPATH' ) || exit;
Expand Down Expand Up @@ -102,6 +101,6 @@ public function get_default_button_text(): string {
* @return string
*/
public function get_button_url(): string {
return wc_get_endpoint_url( Account::FREE_BIDS_SLUG );
return '{user.free_bids_url}';
}
}
12 changes: 12 additions & 0 deletions client-mu-plugins/goodbids/src/classes/Users/FreeBids.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace GoodBids\Users;

use GoodBids\Plugins\WooCommerce\Coupons;
use GoodBids\Plugins\WooCommerce\Account;
use GoodBids\Utilities\Log;
use WP_User;

Expand Down Expand Up @@ -280,6 +281,17 @@ public function get_available_count( ?int $user_id = null ): int {
return $this->get_count( $user_id, self::STATUS_UNUSED );
}

/**
* Get the URL for My Account -> Free Bids
*
* @since 1.0.1
*
* @return string
*/
public function get_free_bids_url(): string {
return wc_get_page_permalink( 'myaccount' ) . Account::FREE_BIDS_SLUG;
}

/**
* Award a Free Bid to a User
*
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<?php
printf(
/* translators: %1$s: Free Bids, %2$s: Refer a Friend link */
esc_html__( 'You have %1$s Free Bids that can be used in any eligible auction. You can earn more by placing one of the first five paid bids in any auction, or by %2$s.', 'goodbids' ),
esc_html__( 'You have %1$s Free Bids that can be used in any eligible auction. You can earn more by placing one of the first five paid bids in any auction, or by %2$s', 'goodbids' ),
'{user.free_bid_count}',
sprintf(
'<a href="%s">%s</a>.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<?php
printf(
/* translators: %1$s: Auction title, %2$s: Auction end time, %3$s: Auction total Bids, %4$s: Auction total Raised, %5$s: Site name */
esc_html__( 'The %1$s GOODBIDS auction ended on %2$s with %3$s placed and %4$s raised for %5$s. Check out the summary below for key auction metrics.', 'goodbids' ),
esc_html__( 'The %1$s GOODBIDS auction ended on %2$s with %3$s bids placed and %4$s raised for %5$s. Check out the summary below for key auction metrics.', 'goodbids' ),
'{auction.title}',
'{auction.end_date_time}',
'{auction.bid_count}',
Expand Down Expand Up @@ -113,7 +113,7 @@
</div>

<p>
<?php esc_html_e( 'The auction has ended. The winner will be notified by email and will be notified by text. The winner has 40 days to claim their reward. We will send you a confirmation email once the reward has been claimed.', 'goodbids' ); ?>
<?php esc_html_e( 'The auction has ended. The winner will be notified by email. The winner has 40 days to claim their reward.', 'goodbids' ); ?>
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<?php
printf(
/* translators: %1$s: Number of Free Bids, %2$s Refer a Friend link */
esc_html__( 'You have %1$s Free Bids that can be used in any eligible auction. You can earn more by placing one of the first five paid bids in any auction, or by %2$s.', 'goodbids' ),
esc_html__( 'You have %1$s Free Bids that can be used in any eligible auction. You can earn more by placing one of the first five paid bids in any auction, or by %2$s', 'goodbids' ),
'{user.free_bid_count}',
sprintf(
'<a href="%s">%s</a>.',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

printf(
/* translators: %1$s: Auction title, %2$s: Auction end time, %3$s: Auction total Bids, %4$s: Auction total Raised, %5$s: Site name */
esc_html__( 'The %1$s GOODBIDS auction ended on %2$s with %3$s placed and %4$s raised for %5$s. Check out the summary below for key auction metrics.', 'goodbids' ),
esc_html__( 'The %1$s GOODBIDS auction ended on %2$s with %3$s bids placed and %4$s raised for %5$s. Check out the summary below for key auction metrics.', 'goodbids' ),
'{auction.title}',
'{auction.end_date_time}',
'{auction.bid_count}',
Expand Down Expand Up @@ -115,7 +115,7 @@

echo "\n\n----------------------------------------\n\n";

esc_html_e( 'The auction has ended. The auctioneer has chosen a winner. The winner will be notified by email and will be notified by text. The winner has 40 days to claim their reward. We will send you a confirmation email once the reward has been claimed.', 'goodbids' );
esc_html_e( 'The auction has ended. The winner will be notified by email. The winner has 40 days to claim their reward.', 'goodbids' );

echo "\n\n----------------------------------------\n\n";

Expand Down

0 comments on commit a48c7db

Please sign in to comment.