-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add metadata to New Follower E-Mail #1172
base: trunk
Are you sure you want to change the base?
Conversation
ca9c4c3
to
49bec73
Compare
$message .= \esc_url( \admin_url( $admin_url ) ) . "\r\n\r\n"; | ||
|
||
\wp_mail( $email, $subject, $message ); | ||
$subject = \sprintf( \__( '[%1$s] Follower: %2$s', 'activitypub' ), get_option( 'blogname' ), $actor['name'] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we call this "New Follower:"?
|
||
$alt_function = function ( $mailer ) use ( $actor, $admin_url ) { | ||
/* translators: 1: Blog name, 2: Follower name */ | ||
$message = \sprintf( \__( 'New Follower: %2$s.', 'activitypub' ), \get_option( 'blogname' ), $actor['name'] ) . "\r\n\r\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't expect to use the blog name, let's just limit it to one placeholder?
$actor = array(); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help me understand why $actor
gets set to an empty array before returning? Does it has to do with how it's being used in new_follower()
later on?
</a> | ||
</td> | ||
<td> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( ! empty( $actor['summary'] ) ) { | ||
echo wp_kses_post( nl2br( $actor['summary'] ) ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( ! empty( $actor['summary'] ) ) { | |
echo wp_kses_post( nl2br( $actor['summary'] ) ); | |
} | |
if ( ! empty( $actor['summary'] ) ) : | |
echo wp_kses_post( nl2br( $actor['summary'] ) ); | |
endif; |
<?php | ||
|
||
/** | ||
* Fires at the bottom of the new follower email. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Fires at the bottom of the new follower email. | |
* Fires at the bottom of the new follower email. | |
* | |
* @param array $actor The actor that followed the blog. |
This adds some metadata like the user icon and the user summary to the new follower e-mail and adds an action for other plugins to include their data (for example, a Follow Back link). See akirk/friends#428