-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat(ras-acc): update otp email template #3032
Merged
chickenn00dle
merged 5 commits into
epic/ras-acc
from
feat/update-transaction-email-colors
Apr 9, 2024
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bc127e1
feat(ras-acc): update otp email template
chickenn00dle 4c74789
feat(ras-acc): add social icons footer to transactional emails
chickenn00dle 8980dc7
fix(ras-acc): fix otp email formatting and translations
chickenn00dle d589b17
fix(ras-acc): email template bg color newsletter conflict
chickenn00dle cc2f298
fix: use newspack theme color functions
chickenn00dle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
.editor-post-title { | ||
display: none; | ||
} | ||
|
||
.editor-styles-wrapper .block-editor-block-list__layout .wp-block-button { | ||
margin-left: 0 !important; | ||
margin-right: 0 !important; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
|
||
namespace Newspack; | ||
|
||
use Newspack\Configuration_Managers; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
define( 'NEWSPACK_API_NAMESPACE', 'newspack/v1' ); | ||
|
@@ -492,3 +494,50 @@ function newspack_get_countries() { | |
} | ||
return $countries_options; | ||
} | ||
|
||
/** | ||
* Get block and html markup for social media services. | ||
* | ||
* @return array An array containing block and html markup for social media services. | ||
*/ | ||
function newspack_get_social_markup() { | ||
$cm = Configuration_Managers::configuration_manager_class_for_plugin_slug( 'wordpress_seo' ); | ||
$social_urls = []; | ||
if ( ! is_wp_error( $cm ) ) { | ||
$social_urls = [ | ||
'facebook' => $cm->get_option( 'facebook_site' ), | ||
'twitter' => $cm->get_option( 'twitter_site' ), | ||
'instagram' => $cm->get_option( 'instagram_url' ), | ||
'youtube' => $cm->get_option( 'youtube_url' ), | ||
]; | ||
} | ||
|
||
$block_markup = ''; | ||
$html_markup = ''; | ||
foreach ( $social_urls as $service => $url ) { | ||
if ( ! empty( $url ) && ! is_wp_error( $url ) ) { | ||
$block_markup .= '<!-- wp:social-link {"url":"' . esc_url( $url ) . '","service":"' . esc_attr( $service ) . '"} /-->'; | ||
$html_markup .= '<td><![endif]--><table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;"><tbody><tr class="social-element"><td style="padding:4px;vertical-align:middle;"><table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:transparent;border-radius:999px;width:24px;"><tbody><tr><td style="padding:7px;font-size:0;height:24px;vertical-align:middle;width:24px;"><a href="' . esc_url( $url ) . '" target="_blank"><img alt="" height="24" src="*SITE_URL*/wp-content/plugins/newspack-newsletters/assets/white-' . $service . '.png" style="border-radius:999px;display:block;" width="24"></a></td></tr></tbody></table></td></tr></tbody></table><!--[if mso | IE]></td>'; | ||
} | ||
} | ||
|
||
return [ | ||
'block_markup' => $block_markup, | ||
'html_markup' => $html_markup, | ||
]; | ||
} | ||
|
||
/** | ||
* Get theme primary and secondary colors or defaults if none present. | ||
* | ||
* @return array An array containing primary and secondary colors. | ||
*/ | ||
function newspack_get_theme_colors() { | ||
$primary_color = get_theme_mod( 'primary_color_hex', '#3366ff' ); | ||
$secondary_color = get_theme_mod( 'secondary_color_hex', '#f0f0f0' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newspack Theme functions should be used (like here). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! I've fixed this in cc2f298 |
||
|
||
return [ | ||
'primary_color' => $primary_color, | ||
'secondary_color' => $secondary_color, | ||
]; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Added these styles to resolve an issue where the button block was forced to be centered in the editor. This overrides the behavior in the editor, but actual emails will still see centered buttons for some reason. (Aside from our updated OTP default template)