mirror of
https://github.com/towfiqi/serpbear
synced 2025-06-26 18:15:54 +00:00
@@ -69,6 +69,7 @@ export const dummySettings = {
|
||||
notification_interval: 'never',
|
||||
notification_email: '',
|
||||
notification_email_from: '',
|
||||
notification_email_from_name: 'SerpBear',
|
||||
smtp_server: '',
|
||||
smtp_port: '',
|
||||
smtp_username: '',
|
||||
|
||||
@@ -89,6 +89,15 @@ const NotificationSettings = ({ settings, settingsError, updateSettings }:Notifi
|
||||
onChange={(value:string) => updateSettings('notification_email_from', value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="settings__section__input mb-5">
|
||||
<InputField
|
||||
label='Email From Name'
|
||||
hasError={settingsError?.type === 'no_smtp_from'}
|
||||
value={settings?.notification_email_from_name || 'Serpbear'}
|
||||
placeholder="Serpbear"
|
||||
onChange={(value:string) => updateSettings('notification_email_from_name', value)}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ const defaultSettings: SettingsType = {
|
||||
smtp_username: '',
|
||||
smtp_password: '',
|
||||
notification_email_from: '',
|
||||
notification_email_from_name: 'SerpBear',
|
||||
search_console: true,
|
||||
search_console_client_email: '',
|
||||
search_console_private_key: '',
|
||||
|
||||
@@ -62,9 +62,10 @@ const sendNotificationEmail = async (domain: Domain, settings: SettingsType) =>
|
||||
smtp_password = '',
|
||||
notification_email = '',
|
||||
notification_email_from = '',
|
||||
notification_email_from_name = 'SerpBear',
|
||||
} = settings;
|
||||
|
||||
const fromEmail = `SerpBear <${notification_email_from || 'no-reply@serpbear.com'}>`;
|
||||
const fromEmail = `${notification_email_from_name} <${notification_email_from || 'no-reply@serpbear.com'}>`;
|
||||
const mailerSettings:any = { host: smtp_server, port: parseInt(smtp_port, 10) };
|
||||
if (smtp_username || smtp_password) {
|
||||
mailerSettings.auth = {};
|
||||
|
||||
@@ -119,6 +119,7 @@ export const getAppSettings = async () : Promise<SettingsType> => {
|
||||
notification_interval: 'never',
|
||||
notification_email: '',
|
||||
notification_email_from: '',
|
||||
notification_email_from_name: 'SerpBear',
|
||||
smtp_server: '',
|
||||
smtp_port: '',
|
||||
smtp_username: '',
|
||||
|
||||
Reference in New Issue
Block a user