Skip to content
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

fix: show frappe_mail_site field while creating Frappe Mail Account #2043

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion desk/src/components/Settings/EmailAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const state: Reactive<EmailAccount> = reactive({
password: "",
api_key: "",
api_secret: "",
frappe_mail_site: "",
enable_incoming: false,
enable_outgoing: false,
default_incoming: false,
Expand Down Expand Up @@ -157,7 +158,7 @@ const addEmailRes = createResource({
},
});

const error = ref("");
const error = ref<string | undefined>();
function createEmailAccount() {
error.value = validateInputs(state, selectedService.value.custom);
if (error.value) return;
Expand Down
6 changes: 4 additions & 2 deletions desk/src/components/Settings/EmailEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const state = reactive({
api_key: props.accountData?.api_key || null,
api_secret: props.accountData?.api_secret || null,
password: props.accountData?.password || null,
frappe_mail_site: props.accountData?.frappe_mail_site || "",
enable_incoming: props.accountData.enable_incoming || false,
enable_outgoing: props.accountData.enable_outgoing || false,
default_outgoing: props.accountData.default_outgoing || false,
Expand All @@ -135,7 +136,7 @@ const fields = computed(() => {
return popularProviderFields;
});

const error = ref("");
const error = ref<string | undefined>();
const loading = ref(false);
async function updateAccount() {
error.value = validateInputs(state, isCustomService.value);
Expand Down Expand Up @@ -189,7 +190,8 @@ const isDirty = computed(() => {
state.enable_incoming !== props.accountData.enable_incoming ||
state.enable_outgoing !== props.accountData.enable_outgoing ||
state.default_outgoing !== props.accountData.default_outgoing ||
state.default_incoming !== props.accountData.default_incoming
state.default_incoming !== props.accountData.default_incoming ||
state.frappe_mail_site !== props.accountData.frappe_mail_site
);
});

Expand Down
6 changes: 6 additions & 0 deletions desk/src/components/Settings/emailConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export const popularProviderFields = [

export const customProviderFields = [
...fixedFields,
{
label: "Frappe Mail Site",
name: "frappe_mail_site",
type: "text",
placeholder: "https://frappemail.com",
},
{
label: "API Key",
name: "api_key",
Expand Down
1 change: 1 addition & 0 deletions desk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export interface EmailAccount {
api_key?: string;
api_secret?: string;
password?: string;
frappe_mail_site?: string;
enable_outgoing?: boolean;
enable_incoming?: boolean;
default_outgoing?: boolean;
Expand Down
1 change: 1 addition & 0 deletions helpdesk/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def create_email_account(data):
if service == "Frappe Mail":
email_doc.api_key = data.get("api_key")
email_doc.api_secret = data.get("api_secret")
email_doc.frappe_mail_site = data.get("frappe_mail_site")
else:
email_doc.password = data.get("password")
# validate whether the credentials are correct
Expand Down
Loading