email application design, how to manage attachments and messages? - asp.net

I am doing an email application which will allow multiple attachments and emails will be send on schaduled date. I have some desgining issues here. Please guide me with your expereienced knowledge.
Email will be stored in db table but attachments will be stored in a folder on server. User will upload files first later his email will be stored in db. I have messages and attachments tables. But there are some cases which system should be able to handle.
How I should store attachments of emails of different users (in one folder or in multiple folders) ?
How attachment naming should be manged, more then one attachments (by one or different users) can have same name ?
User can upload files but later can leave composing message, how system will handle such atachments ?
What will be best time to save email message in db table on user button (save or draf) press or compose page request ? If you suggest on page request then how to handle messages that were not successfully finished ?
Plase guide if I am missing any thing else.
I will be more thankful for your guidance, time and sincere advice.

You have a couple of choices on storage of drafts:
Separate draft table (or set of tables)
Mark message as draft
If drafts can be auto-deleted after some time, the first is easier. It may also be easier to handle the programming to keep it isolated, but flagging the email message in the database as draft works, as well.
When to save? I would save both drafts and ready to send emails, as there is too much risk of losing them if you don't persist them and persistence to a common location is nicer.
Multiple files with same name? Either you physically separate the user's items into different directories or you change the name of the file and store the name it should have as an attachment and have it "renamed" back when the email is sent.
How to handle attachments of emails never properly composed? that is a business decision, not a technical one. Whatever you choose, the user should know the rules.

Related

Keep business variables which should define by admin

I have multi-vendor project which some variables should set by admin, For instance when User wants to pay his/her cart, fee should be specify and it defined by admin of system. (And it could be change passing of time.)
So what's the best approach for keeping this variables?
Note:
I'm running server with Nodejs and I use MongoDB as database.
I have following ideas which has pros and cons in my opinion:
Save these variables in document (in database), which I guess it's not good since I have to for each payment (or other actions which need these variables) send request to database. These variables seems to be fixed and can change after a while. I mean it's not like a user profile information which could change
frequently and when user wants to see his/her profile request should send to database. (further more it's just seems not good create new collection for storing just a document)
Save this in .env file (as environment variables) and I think we keep configuration variables in this file (application layer, not keeping the variables for business) and also updating this file is not good as database.
Please aware me if I make a mistake or there is common way which I don't know. (Also I searched for that and I couldn't find any proper keyword : ( )
My approach has been the following:
If the values can be updated by business administrator in normal course of operation - then they should have Admin UI and be stored in the database. Fees are a good example.
If the values hardly ever change; or changed by IT staff - put them in the configuration file. Endpoint of Vendor API, or mail server configuration would go there.

Flutter: offline local storage syncing with online e.g. firebase

Is this a common/reasonable Use case?
An app allows a user to save favorites locally so that the user doesn't need to signup.
Then the user afterwards desires to share their favorites.
Therefore favorites data needs to be synced from local to remote. The usual local storage for flutter is sqflite, and firebase/store is the remote. However, this seems cumbersome, as sql to nosql conversion is necessary.
I thought that this would be a general issue for UX etc, but I can't find any discussion of this issue? Maybe forcing the user to create an account is the most general solution?
It's a common understanding that if you don't have user account then you can't have any user data associated with your name. You don't have to force the user to have an account or lock them out.
When they favourite something just show a dialog telling them "If you don't have an account your favourites are stored on the device only. If you want your favourites to be available everywhere please create an account" then show options for "Create account" or "No, Thanks"
Create account: Goes to account creation page
No, Thanks: Adds the device to the favourites list and lets the user continue to do what your app does.
There's no problem to solve here from what I'm seeing. If you don't have an account you don't get account functionality. If you track users without them entering anything it's also a little bit illegal and creepy so no need to push the limits on how you can track the same user.
Another way to think of it is to make signup so easy they don't mind and also guarantee that it's worth it. Won't be used for spam or information selling. Take what's app as an example, even though you need to mobile number to send the messages, it's just used as a unique identifier and has nothing to do with the device's number.
Ask for their phone number or email or just any email, you'll most likely get fake info.
And what does your analytics say? Are you getting requests from users saying they lost all their information on a different device? How many people are using your favourite functionality?
I may have come to the party a little late here but here's my 2 cents worth.
The Sql to NoSql conversion is not cumbersome. In fact, there is a reasonable use case for this. I have the same requirement for an app that I am about to build.
Anyway, to store data in RDMDB or NoSQLDB you will need a data model to ensure consistency in your app. If the user has been using the app offline, and they later choose to go online, you can allow them to create the Remote Account, then check if they have local favorites. If they do, you will HAVE to ask them if they'd like to import them into the remote storage. If they choose to do so, you will then have to read their favorites from the local storage and store them in a List<Model> then map() that back to the online storage.
NoSqlDB can accept the json type data, so your model should include the conversion fromMap() and toJson() for this purpose (and others).
When I have come around to doing this, I will share my code (if I remember to come back here).

Google in app purchases google play store on firebase : )

I am a young female developer, but currently i am building a project for a big client in our company,
I have a question, actually one of you can probablly lead me in the right direction:
I have a firebase account and an app with in app purchases - the thing is in app purchases will actually contain videos which i would like to store on firebase servers and download uppon purchase! Can someone lead me in the right direction on how to implement this the easiest way?
Ps., I know i am a rookie but i really do not want to look like an idiot on next months meeting ; )
Warm regards, Lana
Theres honestly no easy way to achieve protecting a file/folder for a specific group of users with firebase cloud storage. You can do checks by changing the folders metadata or using custom tokens, but then you need a server for that etc...
If you wish to remain in a firebase only environment, the easiest way would probably be to have the protected videos hosted in a protected folder from all clients. When the user purchases a video, then send a request a CloudFunction along the lines of..
userClaimsToHaveBoughtAccessToVideo(userId, sku, token, videoId){
// 1. use the googlePlay billing API to verify that the user did indeed purchase the item
// 2. if they did, then store that in read-only node of the database like: /purchasedVideos/userId/videoID/
}
Then if a user wants to download a video, create a function along the lines of...
userWantsToDownloadAVideo(userId, videoId){
// check the database to see if the user has the video
// if they do, copy the video file to a folder like /userId/videos/...
}
Then the video will appear in a personal folder for which the security rules are easy to setup.
When the user downloaded the video to their device send a call to a function along the lines of..
userDownloadedVideo(userId, videoId){
// delete video from the user's folder, to save space
}
Another option would be to host the videos on a different platform entirely, one that has an API and allows it's files to be password protected. (then simply store the access password after verifying IAP in the database, read only for the user), so they can use the other API to download the videos. For security you might want to have a daily job which regenerates the password every day and updates the database..

How can i add email support with asp.net mvc application?

I am working on one asp.net mvc project. In which I want the facility of customer feedback. Suppose I have sent email for getting feedback on our services. So we are sending emails to customers. They gives answer via Reply of that email. And we want to save that reply automatically in database tables. Its sure that we will receive email on one our fixed email address.
So basically i want to store the reply of email from customers into the database with that customer email id. please note here Customers reply email id will be the unique customer field for me.
Is this possible? How can i achieve such functionality? Please suggest me.
Thanks in advance.
Saving email replies has nothing to do with asp.net mvc per se.
having said that, here are some solutions that you can evaluate:
assuming all the replies go to a designated mailbox (Exchange or whatever), you can setup filters (e.g. VBA files in Exchange) which can intercept the incoming emails, parse them and save it to the data base.
if you don't want to mess with mail server native filters, you can write an offline utility (C# console app, windows service, powershell script etc.) which can query a Mailbox and parse the emails and save it to the database.
All of the above approaches have their pros/cons based on ease of installation, logging, maintainability etc.
p.s. please discard the below if it doesn't make any sense for you.
an uber advice i have always received for customer feedback design problems is to get as much objective data as possible. (as opposed to unstructured textual content in an email) and to get objective data,
one option is to have a feedback form on the website where users fill in definitive fields and you can save the information in a very structured and objective manner.
another option is to send them an email with a link to the feedback form on the site, so that if not immediately, they can leisurely come back to the same site and you collect objective data the same way.
saves you the trouble of parsing emails, trying to save email documents, parsing html/string contents, manual intervention to interpret sentiments of the email etc.

How to send an anonymous email through Wordpress?

I have a client who has a crimestoppers' website. They want to provide visitors a means to submit anonymous crime tips, which would then be forwarded to a pre-established email address at the local police department.
What is the best / easiest way to accomplish this? The sender's IP address needs to be hidden. My client also needs to be able to pull reports showing how many tips were submitted and forwarded.
Many thanks!
A simple contact form can be used. It's up to the developer's trust to hide the IP. The submitter won't see anything what is being done using PHP.
You can then update a database with the tips being posted before sending the mails.
In terms of development, you can use a plugin such as Contact Form 7 and then use its hooks to save the tips submitted before sending the mails.
While it is rather simple to set up a contact form that submits to an email address (just use the excellent ContactForm7, as rrikesh's answer suggests). However, getting anonymity right (especially against a party that has as much power and resources) is tricky. You need to be clear about the level of anonymity that you can provide. Log files, document metadata or your ISP can easily give a lot of information away.
Here are two project that have different approaches. They're both not ready-made solutions to your question, but still relevant:
PrivacyBox:
This is a web service run by the German Privacy Foundation. It's basically a message relay like the one you want, except that the user has to trust the Foundation, not you. This model highly depends on the institution providing this service. I'm sure there are other, US-based services like this.
Briefkasten:
An open source software tool used by the German newspaper Die ZEIT.
a reasonably secure web application for submitting content anonymously. It allows to upload attachments which are then sanitized of a number of meta-data which could compromise the submitters identity. Next, the sanitized files are encrypted via GPG and sent via email to a pre-configured list of recipients. The original (potentially 'dirty') files are then deleted from the file system of the server. Thus, neither should admins with access to the server be able to access any submissions, nor should any of the recipients have access to the unsanitized raw material.
This is an attempt to automate the crucial steps to strip any identifying data from the submission and encrypt it, so only the intended recipients can access it.
You would have to host this yourself, though. And it's a Python app.

Resources