diff --git a/includes/Plugin/PluginServiceProvider.php b/includes/Plugin/PluginServiceProvider.php index 855e0a22..802f89e7 100644 --- a/includes/Plugin/PluginServiceProvider.php +++ b/includes/Plugin/PluginServiceProvider.php @@ -593,6 +593,27 @@ public function disable_admin_notices() { remove_all_actions( 'admin_notices' ); remove_all_actions( 'all_admin_notices' ); // Add our own notices after this. + + add_action( 'admin_notices', array( $this, 'render_newsletter_notice' ) ); + } + + /** + * Render the newsletter notice. + */ + public function render_newsletter_notice() { + $current_screen = get_current_screen(); + + // Don't show the notice on response editor screens. + if ( 'omniform_response' === $current_screen->id ) { + return; + } + + printf( + '

%s %s

', + esc_html__( 'Want to stay up to date with OmniForm news?', 'omniform' ), + esc_url( 'https://omniform.io/omniform/newsletter?utm_source=omniform&utm_medium=plugin&utm_content=admin_notice' ), + esc_html__( 'Sign up for our newsletter!', 'omniform' ) + ); } /**