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

feat: 문의하기 기능 구현 #427

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: 문의하기를 누르면 나아가 공식 계정으로 이메일이 보내 지는 기능 구현
hyunji1203 committed Oct 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit aac29de3641cb08a9515f3332890b7ea07f05a19
Original file line number Diff line number Diff line change
@@ -58,6 +58,9 @@ class SettingActivity : AppCompatActivity() {
binding.tvSettingUnlink.setOnClickListener {
showWithdrawalDialog()
}
binding.tvSettingInquiry.setOnClickListener {
sendEmail()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2]
이메일을 성공적으로 보낸 후에 토스트 메시지로 전송되었다고 유저에게 알려주면 더 좋을 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 이메일을 보내는 로직은, intent를 통해 메일 앱으로 연결을 해주어 해당 메일 앱에서 메일을 쓰고 전송하는 방식입니다!
메일 앱으로 이동 시켜 준 후의 상황들은 해당 메일 앱의 관할이기 때문에 저희 앱에선 메일이 잘갔는지 못갔는지 성공 여부를 확인할 방도가 없습니다🥹
따라서 메일을 성공적으로 보냈는 지 확인 후 토스트를 띄우게 하기 위해선 우리 앱이 메일 보내기에 대해 관리를 해주고 있어야하기 때문에..
그때부턴 우리 앱 안에 자체 메일 보내기 뷰를 만들고 SMTP를 사용해 메일을 보내야합니다! 이 로직일 경우에만 성공여부를 확인하고 토스트를 띄워줄 수 있게 되네요..
저도 토스트를 띄워주면 더 좋을 것 같다는 생각은 하지만...
큰 로직 변경 및 뷰 추가가 생겨날 것 같아 이에 대해 크롱의 의견이 궁금합니다!😄

}
}

private fun navigateLogin() {
@@ -91,9 +94,22 @@ class SettingActivity : AppCompatActivity() {
).show(supportFragmentManager, LOGOUT)
}

private fun sendEmail() {
val intent = Intent(Intent.ACTION_SEND)
intent.apply {
type = INTENT_TYPE
val emails = arrayOf(getString(R.string.setting_question_email))
Copy link
Collaborator

@briandr97 briandr97 Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이메일은 로컬라이징 사항일까요?
개인적으로는 아닐 것 같아서 스트링 리소스로 관리하지 않고 상수로 관리하는게 낫지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 저도 이거에 대해서 많이 고민을 하다가 스트링에 넣어줬는데요! 빅스 말처럼 로컬라이징 기준을 고려하지 못했던 것 같아요!
놓쳤던 부분 알려줘서 감사합니다ㅋㅋ👍

putExtra(Intent.EXTRA_EMAIL, emails)
putExtra(Intent.EXTRA_SUBJECT, TITLE)
startActivity(this)
}
}

companion object {
private const val LOGOUT = "LOGOUT"
private const val WITHDRAWAL = "WITHDRAWAL"
private const val INTENT_TYPE = "plain/text"
private const val TITLE = "[나아가에게 문의하기]"

private const val WRONG_AUTH_ERROR_CODE = 101
private const val EXPIRATION_AUTH_ERROR_CODE = 102